mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 11:04:45 +02:00
update to use supervisord
Update the dockerfile to use supervisord Update supervisord config to use start caddy unless configured not to. Updated entrypoint to handle caddy skip for supervisord.
This commit is contained in:
parent
967d02612d
commit
6117282909
6
.github/docker/entrypoint.sh
vendored
6
.github/docker/entrypoint.sh
vendored
@ -42,13 +42,17 @@ php artisan migrate --force
|
||||
echo -e "Starting cron jobs."
|
||||
crond -L /var/log/crond -l 5
|
||||
|
||||
export SUPERVISORD_CADDY=false
|
||||
|
||||
## disable caddy if SKIP_CADDY is set
|
||||
if [[ -z $SKIP_CADDY ]]; then
|
||||
echo "Starting PHP-FPM and Caddy"
|
||||
caddy run --config /etc/caddy/Caddyfile --adapter caddyfile &
|
||||
export SUPERVISORD_CADDY=true
|
||||
else
|
||||
echo "Starting PHP-FPM only"
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data . /pelican-data/.env /pelican-data/database
|
||||
|
||||
echo "Starting Supervisord"
|
||||
exec "$@"
|
||||
|
12
.github/docker/supervisord.conf
vendored
12
.github/docker/supervisord.conf
vendored
@ -25,15 +25,15 @@ autostart=true
|
||||
autorestart=true
|
||||
|
||||
[program:queue-worker]
|
||||
command=/usr/local/bin/php /app/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3
|
||||
user=nginx
|
||||
command=/usr/local/bin/php /var/www/html/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3
|
||||
user=www-data
|
||||
autostart=true
|
||||
autorestart=true
|
||||
|
||||
[program:nginx]
|
||||
command=/usr/sbin/nginx -g 'daemon off;'
|
||||
autostart=true
|
||||
autorestart=true
|
||||
[program:caddy]
|
||||
command=caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
|
||||
autostart=%(ENV_SUPERVISORD_CADDY)s
|
||||
autorestart=%(ENV_SUPERVISORD_CADDY)s
|
||||
priority=10
|
||||
stdout_events_enabled=true
|
||||
stderr_events_enabled=true
|
10
Dockerfile
10
Dockerfile
@ -42,8 +42,9 @@ RUN chmod -R 755 /var/www/html/storage \
|
||||
# Add scheduler to cron
|
||||
RUN echo "* * * * * php /var/www/html/artisan schedule:run >> /dev/null 2>&1" | crontab -u www-data -
|
||||
|
||||
# Create new service for the queue
|
||||
RUN php artisan p:environment:queue-service --service-name=pelican-queue --user=www-data --group=www-data --overwrite
|
||||
## supervisord config and log dir
|
||||
RUN cp .github/docker/supervisord.conf /etc/supervisord.conf && \
|
||||
mkdir /var/log/supervisord/
|
||||
|
||||
HEALTHCHECK --interval=5m --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD curl -f http://localhost/up || exit 1
|
||||
@ -53,8 +54,5 @@ EXPOSE 443
|
||||
|
||||
VOLUME /pelican-data
|
||||
|
||||
# Start PHP-FPM
|
||||
CMD ["sh", "-c", "php-fpm"]
|
||||
|
||||
ENTRYPOINT [ "/bin/ash", ".github/docker/entrypoint.sh" ]
|
||||
# CMD [ "supervisord", "-n", "-c", "/etc/supervisord.conf" ]
|
||||
CMD [ "supervisord", "-n", "-c", "/etc/supervisord.conf" ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user