Docker optimizations

This commit is contained in:
Darko Gjorgjijoski
2026-04-05 12:07:47 +02:00
parent fdd860c381
commit e1af9f56c4
2 changed files with 7 additions and 5 deletions

View File

@@ -19,6 +19,10 @@ FROM serversideup/php:8.4-fpm-nginx-alpine AS base
RUN install-php-extensions intl RUN install-php-extensions intl
RUN install-php-extensions curl 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 FROM base AS production
ENV AUTORUN_ENABLED=true ENV AUTORUN_ENABLED=true
ENV PHP_OPCACHE_ENABLE=1 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 --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 COPY --chown=www-data:www-data . /var/www/html
RUN composer install --prefer-dist --no-dev --optimize-autoloader 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/

View File

@@ -33,8 +33,10 @@ if [ "$DB_CONNECTION" = "sqlite" ] || [ -z "$DB_CONNECTION" ]; then
chown www-data:www-data "$DB_DATABASE" chown www-data:www-data "$DB_DATABASE"
fi fi
echo "**** Setting up artisan permissions ****" echo "**** Setting up folder permissions ****"
chmod +x artisan 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 if [ ! -L /var/www/html/public/storage ]; then
echo "**** Creating storage symlink (public/storage) ****" echo "**** Creating storage symlink (public/storage) ****"