Last active
December 12, 2022 23:52
-
-
Save rgov/55d8c7d800f4d72fe1aa7e585a7261dc to your computer and use it in GitHub Desktop.
Example of using supervisord in a container
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 debian:buster | |
# Install system dependencies | |
RUN apt update \ | |
&& apt install -y \ | |
supervisor \ | |
&& rm -rf /var/lib/apt/lists/* | |
COPY supervisord.conf /etc/supervisor/supervisord.conf | |
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] |
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
[supervisord] | |
nodaemon=true | |
[program:proc_a] | |
command=python3 -m http.server | |
directory=/website | |
[program:proc_b] | |
command=/usr/bin/b | |
# Shut down supervisord if any process exits | |
# https://stackoverflow.com/a/64398319 | |
[eventlistener:shutdown] | |
command=bash -c "echo READY; read LINE; echo Got event: $LINE >&2; kill -SIGQUIT $PPID" | |
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