Skip to content

Commit

Permalink
add supervisor
Browse files Browse the repository at this point in the history
  • Loading branch information
amrikarisma committed Dec 14, 2023
1 parent 02a6659 commit acf98cd
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ RUN mkdir /var/log/php
RUN touch /var/log/php/errors.log && chmod 777 /var/log/php/errors.log

# Copy PHP and Nginx config
COPY --chown=root:root supervisor.conf /etc/supervisor/conf.d/supervisord.conf
COPY --chown=root:root php.ini /usr/local/etc/php/conf.d/app.ini
COPY --chown=root:root nginx.conf /etc/nginx/sites-enabled/default

Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
docker build -t kentos93/php_vestora:latest . && \
docker build --no-cache -t kentos93/php_vestora:latest . && \
docker tag kentos93/php_vestora kentos93/php_vestora:$(date +%s) && \
docker push --all-tags kentos93/php_vestora && \
docker rmi -f $(docker images -q kentos93/php_vestora)
58 changes: 58 additions & 0 deletions supervisor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[supervisord]
nodaemon=true
loglevel = info
logfile=/var/log/supervisord.log
pidfile=/var/run/supervisord.pid

[program:nginx]
priority=10
autostart=true
autorestart=true
killasgroup=true
stopasgroup=true
stderr_logfile_maxbytes=0
stdout_logfile_maxbytes=0
stdout_events_enabled=true
stderr_events_enabled=true
command=/usr/sbin/nginx -g 'daemon off;'
stderr_logfile=/var/log/nginx/error.log
stdout_logfile=/var/log/nginx/access.log

[program:php8-fpm]
priority=5
autostart=true
autorestart=true
killasgroup=true
stopasgroup=true
stderr_logfile_maxbytes=0
stdout_logfile_maxbytes=0
command=/usr/local/sbin/php-fpm -R
stderr_logfile=/var/log/nginx/php-error.log
stdout_logfile=/var/log/nginx/php-access.log

[program:laravel-schedule]
user=root
numprocs=1
autostart=true
autorestart=true
killasgroup=true
stopasgroup=true
redirect_stderr=true
process_name=%(program_name)s_%(process_num)02d
command = /bin/bash -c "/var/www/docker/schedule.sh"
stdout_logfile=/var/log/nginx/schedule.log
priority = 20

[program:laravel-queue]
user=root
numprocs=5
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
redirect_stderr=true
process_name=%(program_name)s_%(process_num)02d
stdout_logfile=/var/log/nginx/worker.log
command=php /var/www/artisan queue:work database --sleep=3 --tries=3
stopwaitsecs=3600
priority = 6

0 comments on commit acf98cd

Please sign in to comment.