From 4568ade773157dd00b33a6235e0f06f500863f0b Mon Sep 17 00:00:00 2001 From: zuka-e <52391918+zuka-e@users.noreply.github.com> Date: Wed, 29 Nov 2023 23:12:20 +0900 Subject: [PATCH] Format `supervisord.conf` (INI) files manually MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ※ INI file doesn't have standardization(?) and any formatter --- .../app/supervisor/supervisord.dev.conf | 64 +++++++++---------- .../app/supervisor/supervisord.prod.conf | 26 ++++---- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/backend/docker/app/supervisor/supervisord.dev.conf b/backend/docker/app/supervisor/supervisord.dev.conf index a1834ea5..1027a97f 100644 --- a/backend/docker/app/supervisor/supervisord.dev.conf +++ b/backend/docker/app/supervisor/supervisord.dev.conf @@ -1,29 +1,29 @@ ; http://supervisord.org/configuration.html [supervisord] -nodaemon=true -user=%(ENV_USER)s -logfile=%(ENV_WORK_DIR)s/storage/logs/supervisord.log -pidfile=/tmp/supervisord.pid +nodaemon = true +user = %(ENV_USER)s +logfile = %(ENV_WORK_DIR)s/storage/logs/supervisord.log +pidfile = /tmp/supervisord.pid ; As seen in the PHP Docker image, `php-fpm` (`CMD`) will be run ; by being read by `ENTRYPOINT` (`.../bin/docker-php-entrypoint`) as its arg. ; Since my `Dockerfile` adds `ENTRYPOINT` and overrides the default, run `php-fpm` here. [program:php-fpm] -command=php-fpm -autostart=true -autorestart=true -stopasgroup=true -killasgroup=true -user=%(ENV_USER)s -redirect_stderr=true -stdout_logfile=%(ENV_WORK_DIR)s/storage/logs/php-fpm.log -stopwaitsecs=3600 +command = php-fpm +autostart = true +autorestart = true +stopasgroup = true +killasgroup = true +user = %(ENV_USER)s +redirect_stderr = true +stdout_logfile = %(ENV_WORK_DIR)s/storage/logs/php-fpm.log +stopwaitsecs = 3600 ; cf. https://laravel.com/docs/10.x/queues#supervisor-configuration [program:laravel-worker] -process_name=%(program_name)s_%(process_num)02d -numprocs=8 +process_name = %(program_name)s_%(process_num)02d +numprocs = 8 ; > during your deployment process, be sure to restart your queue workers. ; > https://laravel.com/docs/10.x/queues#the-queue-work-command ; > a process manager such as Supervisor to automatically restart the queue workers. @@ -32,23 +32,23 @@ numprocs=8 ; In short, restart is required after updated, but not with Supervisor with `max-time`. ; cf. https://laravel.com/docs/10.x/queues#processing-jobs-for-a-given-number-of-seconds ; (After changing `max-time`, Docker rebuild is required) -command=php %(ENV_WORK_DIR)s/artisan queue:work --sleep=3 --tries=3 --max-time=3600 -autostart=true -autorestart=true -stopasgroup=true -killasgroup=true -user=%(ENV_USER)s -redirect_stderr=true -stdout_logfile=%(ENV_WORK_DIR)s/storage/logs/worker.log -stopwaitsecs=3600 +command = php %(ENV_WORK_DIR)s/artisan queue:work --sleep=3 --tries=3 --max-time=3600 +autostart = true +autorestart = true +stopasgroup = true +killasgroup = true +user = %(ENV_USER)s +redirect_stderr = true +stdout_logfile = %(ENV_WORK_DIR)s/storage/logs/worker.log +stopwaitsecs = 3600 ; cf. https://laravel.com/docs/10.x/horizon#supervisor-configuration [program:horizon] -process_name=%(program_name)s -command=php %(ENV_WORK_DIR)s/artisan horizon -autostart=true -autorestart=true -user=%(ENV_USER)s -redirect_stderr=true -stdout_logfile=%(ENV_WORK_DIR)s/storage/logs/horizon.log -stopwaitsecs=3600 +process_name = %(program_name)s +command = php %(ENV_WORK_DIR)s/artisan horizon +autostart = true +autorestart = true +user = %(ENV_USER)s +redirect_stderr = true +stdout_logfile = %(ENV_WORK_DIR)s/storage/logs/horizon.log +stopwaitsecs = 3600 diff --git a/backend/docker/app/supervisor/supervisord.prod.conf b/backend/docker/app/supervisor/supervisord.prod.conf index 4ca36a77..f3af09f0 100644 --- a/backend/docker/app/supervisor/supervisord.prod.conf +++ b/backend/docker/app/supervisor/supervisord.prod.conf @@ -1,21 +1,21 @@ ; http://supervisord.org/configuration.html [supervisord] -nodaemon=true -user=%(ENV_USER)s -logfile=%(ENV_WORK_DIR)s/storage/logs/supervisord.log -pidfile=/tmp/supervisord.pid +nodaemon = true +user = %(ENV_USER)s +logfile = %(ENV_WORK_DIR)s/storage/logs/supervisord.log +pidfile = /tmp/supervisord.pid ; As seen in the PHP Docker image, `php-fpm` (`CMD`) will be run ; by being read by `ENTRYPOINT` (`.../bin/docker-php-entrypoint`) as its arg. ; Since my `Dockerfile` adds `ENTRYPOINT` and overrides the default, run `php-fpm` here. [program:php-fpm] -command=php-fpm -autostart=true -autorestart=true -stopasgroup=true -killasgroup=true -user=%(ENV_USER)s -redirect_stderr=true -stdout_logfile=%(ENV_WORK_DIR)s/storage/logs/php-fpm.log -stopwaitsecs=3600 +command = php-fpm +autostart = true +autorestart = true +stopasgroup = true +killasgroup = true +user = %(ENV_USER)s +redirect_stderr = true +stdout_logfile = %(ENV_WORK_DIR)s/storage/logs/php-fpm.log +stopwaitsecs = 3600