Created
January 14, 2021 18:15
-
-
Save htuscher/8458198e005ef2e1c9f8f8ebfd8994f6 to your computer and use it in GitHub Desktop.
The entrypoint of `webdevops/php-nginx:7.4` allows to start a different entrypoint script. The default starts the supervisord but we can switch to a worker.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy this file to /opt/docker/etc/supervisor.d/worker.conf | |
[group:worker] | |
programs=queue-worker | |
priority=25 | |
[program:queue-worker] | |
command = /app/bin/console messenger:consume default --time-limit=180 -vv | |
user = application | |
process_name=%(program_name)s | |
startsecs = 0 | |
autostart = false | |
autorestart = true | |
stdout_logfile=/dev/stdout | |
stdout_logfile_maxbytes=0 | |
stderr_logfile=/dev/stderr | |
stderr_logfile_maxbytes=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Copy this file to /opt/docker/bin/entrypoint.d/worker.sh | |
# Clear all other processes | |
cp /opt/docker/etc/supervisor.d/worker.conf /tmp/worker.conf | |
rm -f /opt/docker/etc/supervisor.d/*.conf | |
mv /tmp/worker.conf /opt/docker/etc/supervisor.d/worker.conf | |
# Enable the worker service (disabled by default) | |
docker-service enable worker | |
############################################# | |
## Supervisord (start daemons) | |
############################################# | |
## Start services | |
exec /opt/docker/bin/service.d/supervisor.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment