feat(docker): use supervisord (#3129)

This commit is contained in:
Alexis Saettler
2019-10-25 20:38:06 +02:00
committed by GitHub
parent 689fc0dfcc
commit b8d2ed65ec
9 changed files with 106 additions and 21 deletions
+4 -2
View File
@@ -114,7 +114,7 @@ RUN set -ex && \
cd /etc/cron.hourly && \
{ \
echo '#!/bin/sh'; \
echo '/usr/bin/php /var/www/monica/artisan schedule:run -v'; \
echo '/usr/bin/php /var/www/monica/artisan schedule:run -v > /proc/1/fd/1 2> /proc/1/fd/2'; \
} | tee monica && \
chmod a+x monica
@@ -129,4 +129,6 @@ RUN a2enconf hostname
RUN a2enmod rewrite cache headers
EXPOSE 80
CMD ["apache2-foreground"]
COPY scripts/docker/php-apache/supervisord.conf /etc/supervisord.conf
CMD ["supervisord", "-c /etc/supervisord.conf"]
@@ -0,0 +1,30 @@
[supervisord]
nodaemon=true
user=root
[program:cron]
command=/usr/sbin/cron -f -L 0
autostart=true
autorestart=true
[program:queue]
process_name=%(program_name)s_%(process_num)02d
command=/usr/bin/php /var/www/monica/artisan queue:work --sleep=10 --timeout=0 --tries=3 --queue=default,migration
numprocs=1
stdout_logfile=/proc/1/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/proc/1/fd/2
stderr_logfile_maxbytes=0
autostart=true
autorestart=true
startretries=0
[program:apache]
process_name=%(program_name)s_%(process_num)02d
command=/usr/local/bin/apache2-foreground
stdout_logfile=/proc/1/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/proc/1/fd/2
stderr_logfile_maxbytes=0
autostart=true
autorestart=true