Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Run nginx and gunicorn in docker via supervisor #1313
Currently the nginx process is run in the background of the docker container and the gunicorn process is run in the foreground. This means that if the nginx process crashes, it won't get restarted and the nginx
This change introduces the supervisor process manager to run as the single foreground process in docker. The supervisor process in turn takes care of running both nginx and gunicorn.
Note that supervisor has its own environment variable isolation and doesn't have an easy way of passing all the environment variables to the child process. As a work-around to avoid having to declare all environment variables multiple times, we first dump the environment into files and then reload them in the child process from the files via the envdir utility.