diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile index 403f68fb..85d5e35b 100644 --- a/docker/production/Dockerfile +++ b/docker/production/Dockerfile @@ -19,6 +19,10 @@ FROM serversideup/php:8.4-fpm-nginx-alpine AS base RUN install-php-extensions intl RUN install-php-extensions curl + # Copy entrypoint and inject script, and make sure they are executable + COPY --chmod=755 docker/production/inject.sh /inject.sh + COPY --chmod=755 docker/production/entrypoint.d/ /etc/entrypoint.d/ + FROM base AS production ENV AUTORUN_ENABLED=true ENV PHP_OPCACHE_ENABLE=1 @@ -36,7 +40,3 @@ FROM base AS production COPY --from=static_builder --chown=www-data:www-data /var/www/html/public /var/www/html/public COPY --chown=www-data:www-data . /var/www/html RUN composer install --prefer-dist --no-dev --optimize-autoloader - - # Copy entrypoint and inject script, and make sure they are executable - COPY --chmod=755 docker/production/inject.sh /inject.sh - COPY --chmod=755 docker/production/entrypoint.d/ /etc/entrypoint.d/ diff --git a/docker/production/entrypoint.d/00-setup.sh b/docker/production/entrypoint.d/00-setup.sh index 1a23fcf2..93a1b99c 100644 --- a/docker/production/entrypoint.d/00-setup.sh +++ b/docker/production/entrypoint.d/00-setup.sh @@ -33,8 +33,10 @@ if [ "$DB_CONNECTION" = "sqlite" ] || [ -z "$DB_CONNECTION" ]; then chown www-data:www-data "$DB_DATABASE" fi -echo "**** Setting up artisan permissions ****" +echo "**** Setting up folder permissions ****" chmod +x artisan +chown -R www-data:www-data storage bootstrap/cache +chmod -R 775 storage bootstrap/cache if [ ! -L /var/www/html/public/storage ]; then echo "**** Creating storage symlink (public/storage) ****"