From 9fa62a78767227236467a65b11028876277de9db Mon Sep 17 00:00:00 2001 From: Bram Date: Fri, 29 Dec 2023 22:00:07 +0000 Subject: [PATCH] [1.x] Allow easy customization of the command ran by supervisor's PHP process (#645) * Add PHP_COMMAND environment variable to Dockerfile * Add environment variable substitution in supervisord.conf * Fix variable name --- runtimes/8.0/Dockerfile | 1 + runtimes/8.0/supervisord.conf | 2 +- runtimes/8.1/Dockerfile | 1 + runtimes/8.1/supervisord.conf | 2 +- runtimes/8.2/Dockerfile | 1 + runtimes/8.2/supervisord.conf | 2 +- runtimes/8.3/Dockerfile | 1 + runtimes/8.3/supervisord.conf | 2 +- 8 files changed, 8 insertions(+), 4 deletions(-) diff --git a/runtimes/8.0/Dockerfile b/runtimes/8.0/Dockerfile index d4cd0d36..a6dabe6b 100644 --- a/runtimes/8.0/Dockerfile +++ b/runtimes/8.0/Dockerfile @@ -10,6 +10,7 @@ WORKDIR /var/www/html ENV DEBIAN_FRONTEND noninteractive ENV TZ=UTC +ENV SUPERVISOR_PHP_COMMAND="/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80" RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone diff --git a/runtimes/8.0/supervisord.conf b/runtimes/8.0/supervisord.conf index 9d284795..26ccc0a5 100644 --- a/runtimes/8.0/supervisord.conf +++ b/runtimes/8.0/supervisord.conf @@ -5,7 +5,7 @@ logfile=/var/log/supervisor/supervisord.log pidfile=/var/run/supervisord.pid [program:php] -command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80 +command=%(ENV_SUPERVISOR_PHP_COMMAND)s user=sail environment=LARAVEL_SAIL="1" stdout_logfile=/dev/stdout diff --git a/runtimes/8.1/Dockerfile b/runtimes/8.1/Dockerfile index e62b4371..746f3ecb 100644 --- a/runtimes/8.1/Dockerfile +++ b/runtimes/8.1/Dockerfile @@ -10,6 +10,7 @@ WORKDIR /var/www/html ENV DEBIAN_FRONTEND noninteractive ENV TZ=UTC +ENV SUPERVISOR_PHP_COMMAND="/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80" RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone diff --git a/runtimes/8.1/supervisord.conf b/runtimes/8.1/supervisord.conf index 9d284795..26ccc0a5 100644 --- a/runtimes/8.1/supervisord.conf +++ b/runtimes/8.1/supervisord.conf @@ -5,7 +5,7 @@ logfile=/var/log/supervisor/supervisord.log pidfile=/var/run/supervisord.pid [program:php] -command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80 +command=%(ENV_SUPERVISOR_PHP_COMMAND)s user=sail environment=LARAVEL_SAIL="1" stdout_logfile=/dev/stdout diff --git a/runtimes/8.2/Dockerfile b/runtimes/8.2/Dockerfile index 414301f1..3de361ef 100644 --- a/runtimes/8.2/Dockerfile +++ b/runtimes/8.2/Dockerfile @@ -10,6 +10,7 @@ WORKDIR /var/www/html ENV DEBIAN_FRONTEND noninteractive ENV TZ=UTC +ENV SUPERVISOR_PHP_COMMAND="/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80" RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone diff --git a/runtimes/8.2/supervisord.conf b/runtimes/8.2/supervisord.conf index 9d284795..26ccc0a5 100644 --- a/runtimes/8.2/supervisord.conf +++ b/runtimes/8.2/supervisord.conf @@ -5,7 +5,7 @@ logfile=/var/log/supervisor/supervisord.log pidfile=/var/run/supervisord.pid [program:php] -command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80 +command=%(ENV_SUPERVISOR_PHP_COMMAND)s user=sail environment=LARAVEL_SAIL="1" stdout_logfile=/dev/stdout diff --git a/runtimes/8.3/Dockerfile b/runtimes/8.3/Dockerfile index 789df190..a4fa8890 100644 --- a/runtimes/8.3/Dockerfile +++ b/runtimes/8.3/Dockerfile @@ -10,6 +10,7 @@ WORKDIR /var/www/html ENV DEBIAN_FRONTEND noninteractive ENV TZ=UTC +ENV SUPERVISOR_PHP_COMMAND="/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80" RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone diff --git a/runtimes/8.3/supervisord.conf b/runtimes/8.3/supervisord.conf index 9d284795..26ccc0a5 100644 --- a/runtimes/8.3/supervisord.conf +++ b/runtimes/8.3/supervisord.conf @@ -5,7 +5,7 @@ logfile=/var/log/supervisor/supervisord.log pidfile=/var/run/supervisord.pid [program:php] -command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80 +command=%(ENV_SUPERVISOR_PHP_COMMAND)s user=sail environment=LARAVEL_SAIL="1" stdout_logfile=/dev/stdout