Skip to content

Commit ce7c4fd

Browse files
authored
Improve Supervisor setup (exaco#74)
1 parent 2e6f5a4 commit ce7c4fd

10 files changed

+57
-55
lines changed

FrankenPHP.Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ RUN apt-get update; \
7878
wget \
7979
nano \
8080
ncdu \
81+
procps \
8182
ca-certificates \
8283
supervisor \
8384
libsodium-dev \
@@ -143,6 +144,7 @@ RUN mkdir -p \
143144
storage/logs \
144145
bootstrap/cache && chmod -R a+rw storage
145146

147+
COPY --chown=${USER}:${USER} deployment/supervisord.conf /etc/supervisor/
146148
COPY --chown=${USER}:${USER} deployment/octane/FrankenPHP/supervisord.frankenphp.conf /etc/supervisor/conf.d/
147149
COPY --chown=${USER}:${USER} deployment/supervisord.*.conf /etc/supervisor/conf.d/
148150
COPY --chown=${USER}:${USER} deployment/start-container /usr/local/bin/start-container

RoadRunner.Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ RUN apt-get update; \
7373
wget \
7474
nano \
7575
ncdu \
76+
procps \
7677
ca-certificates \
7778
supervisor \
7879
libsodium-dev \
@@ -138,6 +139,7 @@ RUN mkdir -p \
138139
storage/logs \
139140
bootstrap/cache && chmod -R a+rw storage
140141

142+
COPY --chown=${USER}:${USER} deployment/supervisord.conf /etc/supervisor/
141143
COPY --chown=${USER}:${USER} deployment/octane/RoadRunner/supervisord.roadrunner.conf /etc/supervisor/conf.d
142144
COPY --chown=${USER}:${USER} deployment/supervisord.*.conf /etc/supervisor/conf.d/
143145
COPY --chown=${USER}:${USER} deployment/php.ini ${PHP_INI_DIR}/conf.d/99-octane.ini

Swoole.Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ RUN apt-get update; \
7373
wget \
7474
nano \
7575
ncdu \
76+
procps \
7677
ca-certificates \
7778
supervisor \
7879
libsodium-dev \
@@ -139,6 +140,7 @@ RUN mkdir -p \
139140
storage/logs \
140141
bootstrap/cache && chmod -R a+rw storage
141142

143+
COPY --chown=${USER}:${USER} deployment/supervisord.conf /etc/supervisor/
142144
COPY --chown=${USER}:${USER} deployment/octane/Swoole/supervisord.swoole.conf /etc/supervisor/conf.d/
143145
COPY --chown=${USER}:${USER} deployment/supervisord.*.conf /etc/supervisor/conf.d/
144146
COPY --chown=${USER}:${USER} deployment/php.ini ${PHP_INI_DIR}/conf.d/99-octane.ini

deployment/octane/FrankenPHP/supervisord.frankenphp.conf

+9-12
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
[supervisord]
2-
nodaemon=true
3-
user=%(ENV_USER)s
4-
logfile=/var/log/supervisor/supervisord.log
5-
pidfile=/var/run/supervisord.pid
6-
71
[program:octane]
82
process_name=%(program_name)s_%(process_num)02d
93
command=php %(ENV_ROOT)s/artisan octane:start --server=frankenphp --host=0.0.0.0 --port=8000 --admin-port=2019
@@ -24,9 +18,9 @@ user=%(ENV_USER)s
2418
autostart=%(ENV_WITH_HORIZON)s
2519
autorestart=true
2620
stdout_logfile=%(ENV_ROOT)s/storage/logs/horizon.log
27-
stdout_logfile_maxbytes=0
21+
stdout_logfile_maxbytes=200MB
2822
stderr_logfile=%(ENV_ROOT)s/storage/logs/horizon.log
29-
stderr_logfile_maxbytes=0
23+
stderr_logfile_maxbytes=200MB
3024
stopwaitsecs=3600
3125

3226
[program:scheduler]
@@ -36,9 +30,9 @@ user=%(ENV_USER)s
3630
autostart=%(ENV_WITH_SCHEDULER)s
3731
autorestart=true
3832
stdout_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
39-
stdout_logfile_maxbytes=0
33+
stdout_logfile_maxbytes=200MB
4034
stderr_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
41-
stderr_logfile_maxbytes=0
35+
stderr_logfile_maxbytes=200MB
4236

4337
[program:clear-scheduler-cache]
4438
process_name=%(program_name)s_%(process_num)02d
@@ -49,6 +43,9 @@ autorestart=false
4943
startsecs=0
5044
startretries=1
5145
stdout_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
52-
stdout_logfile_maxbytes=0
46+
stdout_logfile_maxbytes=200MB
5347
stderr_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
54-
stderr_logfile_maxbytes=0
48+
stderr_logfile_maxbytes=200MB
49+
50+
[include]
51+
files=/etc/supervisor/supervisord.conf

deployment/octane/RoadRunner/supervisord.roadrunner.conf

+9-12
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
[supervisord]
2-
nodaemon=true
3-
user=%(ENV_USER)s
4-
logfile=/var/log/supervisor/supervisord.log
5-
pidfile=/var/run/supervisord.pid
6-
71
[program:octane]
82
process_name=%(program_name)s_%(process_num)02d
93
command=php %(ENV_ROOT)s/artisan octane:start --server=roadrunner --host=0.0.0.0 --port=8000 --rpc-port=6001 --rr-config=%(ENV_ROOT)s/.rr.yaml
@@ -23,9 +17,9 @@ user=%(ENV_USER)s
2317
autostart=%(ENV_WITH_HORIZON)s
2418
autorestart=true
2519
stdout_logfile=%(ENV_ROOT)s/storage/logs/horizon.log
26-
stdout_logfile_maxbytes=0
20+
stdout_logfile_maxbytes=200MB
2721
stderr_logfile=%(ENV_ROOT)s/storage/logs/horizon.log
28-
stderr_logfile_maxbytes=0
22+
stderr_logfile_maxbytes=200MB
2923
stopwaitsecs=3600
3024

3125
[program:scheduler]
@@ -35,9 +29,9 @@ user=%(ENV_USER)s
3529
autostart=%(ENV_WITH_SCHEDULER)s
3630
autorestart=true
3731
stdout_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
38-
stdout_logfile_maxbytes=0
32+
stdout_logfile_maxbytes=200MB
3933
stderr_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
40-
stderr_logfile_maxbytes=0
34+
stderr_logfile_maxbytes=200MB
4135

4236
[program:clear-scheduler-cache]
4337
process_name=%(program_name)s_%(process_num)02d
@@ -48,6 +42,9 @@ autorestart=false
4842
startsecs=0
4943
startretries=1
5044
stdout_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
51-
stdout_logfile_maxbytes=0
45+
stdout_logfile_maxbytes=200MB
5246
stderr_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
53-
stderr_logfile_maxbytes=0
47+
stderr_logfile_maxbytes=200MB
48+
49+
[include]
50+
files=/etc/supervisor/supervisord.conf

deployment/octane/Swoole/supervisord.swoole.conf

+9-12
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
[supervisord]
2-
nodaemon=true
3-
user=%(ENV_USER)s
4-
logfile=/var/log/supervisor/supervisord.log
5-
pidfile=/var/run/supervisord.pid
6-
71
[program:octane]
82
process_name=%(program_name)s_%(process_num)02d
93
command=php %(ENV_ROOT)s/artisan octane:start --server=swoole --host=0.0.0.0 --port=8000
@@ -23,9 +17,9 @@ user=%(ENV_USER)s
2317
autostart=%(ENV_WITH_HORIZON)s
2418
autorestart=true
2519
stdout_logfile=%(ENV_ROOT)s/storage/logs/horizon.log
26-
stdout_logfile_maxbytes=0
20+
stdout_logfile_maxbytes=200MB
2721
stderr_logfile=%(ENV_ROOT)s/storage/logs/horizon.log
28-
stderr_logfile_maxbytes=0
22+
stderr_logfile_maxbytes=200MB
2923
stopwaitsecs=3600
3024

3125
[program:scheduler]
@@ -35,9 +29,9 @@ user=%(ENV_USER)s
3529
autostart=%(ENV_WITH_SCHEDULER)s
3630
autorestart=true
3731
stdout_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
38-
stdout_logfile_maxbytes=0
32+
stdout_logfile_maxbytes=200MB
3933
stderr_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
40-
stderr_logfile_maxbytes=0
34+
stderr_logfile_maxbytes=200MB
4135

4236
[program:clear-scheduler-cache]
4337
process_name=%(program_name)s_%(process_num)02d
@@ -48,6 +42,9 @@ autorestart=false
4842
startsecs=0
4943
startretries=1
5044
stdout_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
51-
stdout_logfile_maxbytes=0
45+
stdout_logfile_maxbytes=200MB
5246
stderr_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
53-
stderr_logfile_maxbytes=0
47+
stderr_logfile_maxbytes=200MB
48+
49+
[include]
50+
files=/etc/supervisor/supervisord.conf

deployment/supervisord.conf

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[supervisord]
2+
nodaemon=true
3+
user=%(ENV_USER)s
4+
logfile=/var/log/supervisor/supervisord.log
5+
pidfile=/var/run/supervisord.pid
6+
7+
[unix_http_server]
8+
file=/var/run/supervisor.sock
9+
10+
[supervisorctl]
11+
serverurl=unix:///var/run/supervisor.sock
12+
13+
[rpcinterface:supervisor]
14+
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface

deployment/supervisord.horizon.conf

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
[supervisord]
2-
nodaemon=true
3-
user=%(ENV_USER)s
4-
logfile=/var/log/supervisor/supervisord.log
5-
pidfile=/var/run/supervisord.pid
6-
71
[program:horizon]
82
process_name=%(program_name)s_%(process_num)02d
93
command=php %(ENV_ROOT)s/artisan horizon
@@ -15,3 +9,6 @@ stdout_logfile_maxbytes=0
159
stderr_logfile=/dev/stderr
1610
stderr_logfile_maxbytes=0
1711
stopwaitsecs=3600
12+
13+
[include]
14+
files=/etc/supervisor/supervisord.conf

deployment/supervisord.scheduler.conf

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
[supervisord]
2-
nodaemon=true
3-
user=%(ENV_USER)s
4-
logfile=/var/log/supervisor/supervisord.log
5-
pidfile=/var/run/supervisord.pid
6-
71
[program:scheduler]
82
process_name=%(program_name)s_%(process_num)02d
93
command=supercronic -overlapping /etc/supercronic/laravel
@@ -26,4 +20,7 @@ startretries=1
2620
stdout_logfile=/dev/stdout
2721
stdout_logfile_maxbytes=0
2822
stderr_logfile=/dev/stderr
29-
stderr_logfile_maxbytes=0
23+
stderr_logfile_maxbytes=0
24+
25+
[include]
26+
files=/etc/supervisor/supervisord.conf

deployment/supervisord.worker.conf

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
[supervisord]
2-
nodaemon=true
3-
user=%(ENV_USER)s
4-
logfile=/var/log/supervisor/supervisord.log
5-
pidfile=/var/run/supervisord.pid
6-
71
[program:worker]
82
process_name=%(program_name)s_%(process_num)02d
93
command=%(ENV_WORKER_COMMAND)s
@@ -14,3 +8,6 @@ stdout_logfile=/dev/stdout
148
stdout_logfile_maxbytes=0
159
stderr_logfile=/dev/stderr
1610
stderr_logfile_maxbytes=0
11+
12+
[include]
13+
files=/etc/supervisor/supervisord.conf

0 commit comments

Comments
 (0)