Last active
July 3, 2019 10:21
-
-
Save ReallyLiri/f833510d350b242ff89b9b76fdf21ea5 to your computer and use it in GitHub Desktop.
Make tiangolo/uwsgi-nginx crash on python app failure
This file contains 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
FROM tiangolo/uwsgi-nginx:python3.7 | |
# or FROM tiangolo/uwsgi-nginx-flask:python3.7 | |
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | |
COPY stop-supervisor.sh /etc/supervisor/stop-supervisor.sh | |
RUN chmod +x /etc/supervisor/stop-supervisor.sh |
This file contains 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
#!/bin/bash | |
printf "READY\n"; | |
while read line; do | |
echo "Processing Event: $line" >&2; | |
kill -3 $(cat "/var/run/supervisord.pid") | |
done < /dev/stdin |
This file contains 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
# copied from https://github.com/tiangolo/uwsgi-nginx-docker/blob/master/python3.7/supervisord.conf | |
[supervisord] | |
nodaemon=true | |
[program:uwsgi] | |
command=/usr/local/bin/uwsgi --ini /etc/uwsgi/uwsgi.ini | |
stdout_logfile=/dev/stdout | |
stdout_logfile_maxbytes=0 | |
stderr_logfile=/dev/stderr | |
stderr_logfile_maxbytes=0 | |
startsecs = 0 | |
autorestart=false | |
[program:nginx] | |
command=/usr/sbin/nginx | |
stdout_logfile=/dev/stdout | |
stdout_logfile_maxbytes=0 | |
stderr_logfile=/dev/stderr | |
stderr_logfile_maxbytes=0 | |
# Graceful stop, see http://nginx.org/en/docs/control.html | |
stopsignal=QUIT | |
[eventlistener:processes] | |
command=/etc/supervisor/stop-supervisor.sh | |
events=PROCESS_STATE_STOPPED, PROCESS_STATE_EXITED, PROCESS_STATE_FATAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tiangolo/uwsgi-nginx-docker#61