From ca5240aa6a55b5eceb41c891a578be25be933684 Mon Sep 17 00:00:00 2001 From: Suriya Date: Wed, 29 Apr 2026 13:53:42 +0530 Subject: [PATCH] fix: switch to minimal PHP-CLI on port 8080 for testing --- Dockerfile | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5193f1c..7fdcb33 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,15 @@ -FROM php:8.3-apache +FROM php:8.3-cli -# Suppress ServerName warning -RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf +# Copy the application files +COPY . /app +WORKDIR /app -# Increase PHP limits for large code files -RUN echo "memory_limit=512M" > /usr/local/etc/php/conf.d/custom.ini \ - && echo "max_execution_time=300" >> /usr/local/etc/php/conf.d/custom.ini +# Set permissions +RUN chown -R www-data:www-data /app -COPY . /var/www/html/ -RUN chown -R www-data:www-data /var/www/html +# Expose port 8080 +EXPOSE 8080 -# Dynamically set the port to $PORT (defaulting to 80 if not set) -# We use the shell form of CMD to ensure variable expansion -CMD sed -i "s/Listen 80/Listen ${PORT:-80}/g" /etc/apache2/ports.conf && \ - sed -i "s///g" /etc/apache2/sites-available/000-default.conf && \ - apache2-foreground +# Start the built-in PHP server on port 8080 (listening on all interfaces) +# We use -t /app to set the document root +CMD ["php", "-S", "0.0.0.0:8080", "-t", "/app"]