From 65ab68ca7843374c4fc316ea4ec1bc49533d665d Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 10:59:36 +0000 Subject: [PATCH] Fix Dockerfile: remove unused packages, improve caching, start cron daemon (#3151) * Fix Dockerfile: update PHP version, remove unused packages, improve caching, and start cron daemon Co-authored-by: admdly <2807620+admdly@users.noreply.github.com> * Revert PHP version to 8.5-apache with SHA pinning Co-authored-by: admdly <2807620+admdly@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: admdly <2807620+admdly@users.noreply.github.com> --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0bd8c5d47..d8ea0959d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM php:8.5-apache@sha256:96b50b7861cb6d1c10cd9f58c46b2c19606761a1209c20d410a50 # Install required packages, configure Apache, install PHP extensions, and clean-up. RUN apt-get update \ - && apt-get install -y --no-install-recommends wget unzip zlib1g-dev libpng-dev libicu-dev libbz2-dev cron \ + && apt-get install -y --no-install-recommends zlib1g-dev libpng-dev libicu-dev libbz2-dev cron \ && a2enmod rewrite \ && docker-php-ext-configure bz2 \ && docker-php-ext-install -j$(nproc) bz2 \ @@ -13,9 +13,12 @@ RUN apt-get update \ && docker-php-ext-configure pdo_mysql \ && docker-php-ext-install -j$(nproc) pdo_mysql \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* /var/cache/apt/* # Copy files and set required permissions. COPY --chown=www-data:www-data ./src/. /var/www/html RUN { crontab -l -u www-data 2>/dev/null; echo "*/5 * * * * /usr/local/bin/php /var/www/html/cron.php"; } | crontab -u www-data - + +# Start cron and then run Apache in the foreground when the container starts. +CMD service cron start && apache2-foreground