From f4ccbadf34d77aa86f910cdddcd9f081f451a087 Mon Sep 17 00:00:00 2001 From: Suriya Date: Wed, 29 Apr 2026 13:50:42 +0530 Subject: [PATCH] fix: debug with info.php and robust port handling --- Dockerfile | 20 ++++++++++++-------- info.php | 3 +++ 2 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 info.php diff --git a/Dockerfile b/Dockerfile index 032bd27..5193f1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,17 @@ FROM php:8.3-apache -# Copy the application files to the Apache web root -COPY . /var/www/html/ +# Suppress ServerName warning +RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf -# Ensure proper permissions +# 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 + +COPY . /var/www/html/ RUN chown -R www-data:www-data /var/www/html -# Change Apache to listen on port 8080 instead of 80 -RUN sed -i 's/80/8080/g' /etc/apache2/sites-available/000-default.conf /etc/apache2/ports.conf -EXPOSE 8080 - -CMD ["apache2-foreground"] +# 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 diff --git a/info.php b/info.php new file mode 100644 index 0000000..cf60860 --- /dev/null +++ b/info.php @@ -0,0 +1,3 @@ +