Skip to content

Instantly share code, notes, and snippets.

@htuscher
Created January 14, 2021 18:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save htuscher/8458198e005ef2e1c9f8f8ebfd8994f6 to your computer and use it in GitHub Desktop.
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.
# 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
#!/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