Create file: /etc/supervisor/conf.d/php-worker.conf
[program:billrun_worker]
command=php /billrun/index.php --env container --worker
autostart=true
autorestart=true
startretries=3
user=www-data
apt update && apt install -y supervisor
Create shell script to run on container load:
mkdir -p /var/log/supervisor
echo_supervisord_conf > /etc/supervisor/supervisord.conf
echo "[include]" >> /etc/supervisor/supervisord.conf
echo "files = /etc/supervisor/conf.d/*.conf" >> /etc/supervisor/supervisord.conf
CMD ["supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]