From c1fe643b05d736ed6089b47b5ef2e55e2cc8f0a9 Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Sun, 27 Oct 2024 12:17:46 +0100 Subject: [PATCH] feat: allow port to be set with environment variable --- Dockerfile | 7 ++++--- includes/version.php | 2 +- nginx.conf | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 29ad08729..57d3894dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,10 +36,11 @@ RUN dos2unix /etc/cron.d/cronjobs && \ echo 'pm.max_children = 15' >> /usr/local/etc/php-fpm.d/zz-docker.conf && \ echo 'pm.max_requests = 500' >> /usr/local/etc/php-fpm.d/zz-docker.conf -# Expose port 80 for Nginx -EXPOSE 80 +# Default port +ENV PORT 80 -ARG SOFTWARE_VERSION=1.20.0 +# Expose the port +EXPOSE ${PORT} # Start both PHP-FPM, Nginx CMD ["sh", "-c", "/var/www/html/startup.sh"] diff --git a/includes/version.php b/includes/version.php index 9f22fc4f0..f9c07a770 100644 --- a/includes/version.php +++ b/includes/version.php @@ -1,3 +1,3 @@ \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index 284ea77e1..db136c580 100644 --- a/nginx.conf +++ b/nginx.conf @@ -22,7 +22,7 @@ http { keepalive_timeout 65; server { - listen 80; + listen ${PORT}; server_name localhost; location / {