File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -34,10 +34,11 @@ ENV COMPOSER_ALLOW_SUPERUSER=1
3434# Change PHP config
3535COPY docker/php/php.ini /usr/local/etc/php/conf.d/base.ini
3636
37- # Install supervisord and Node.js (includes npm)
37+ # Install supervisord, Node.js, and su-exec
3838RUN apt-get update && apt-get install -y \
3939 supervisor \
4040 curl \
41+ su-exec \
4142 --no-install-recommends \
4243 && curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
4344 && apt-get install -y nodejs \
Original file line number Diff line number Diff line change @@ -48,18 +48,13 @@ echo -e "${GREEN}Setup completed.${NC}"
4848if [ -f " /app/composer.json" ] && [ ! -d " /app/vendor" ]; then
4949 echo -e " ${YELLOW} Installing Composer dependencies...${NC} "
5050
51- # Install dependencies based on environment
51+ # Install dependencies based on environment AS www-data user
5252 if [ " $YII_ENV " = " prod" ]; then
5353 # Production: exclude dev dependencies and optimize autoloader
54- composer install --no-dev --optimize-autoloader --no-interaction
54+ su-exec www-data composer install --no-dev --optimize-autoloader --no-interaction
5555 else
5656 # Development: include dev dependencies
57- composer install --optimize-autoloader --no-interaction
58- fi
59-
60- # Set proper ownership for vendor directory if possible
61- if chown -R www-data:www-data /app/vendor 2> /dev/null; then
62- echo -e " ${GREEN} ✓ Vendor directory ownership set${NC} "
57+ su-exec www-data composer install --optimize-autoloader --no-interaction
6358 fi
6459
6560 echo -e " ${GREEN} ✓ Composer dependencies installed successfully.${NC} "
You can’t perform that action at this time.
0 commit comments