July 2017
Beginner to intermediate
340 pages
7h 43m
English
If we reuse the Circus and Chaussette setup from Chapter 9, Packaging Runnerly, Circus can bind a socket on port 5000, and fork a few Flask processes, which will accept connection on that socket. Circus can also watch the single nginx process we want to run in our container.
The first step to using Circus as a process manager in our container is to install it, together with Chaussette, as follows:
RUN pip install circus chaussette
From there, the following Circus configuration is similar to what we had in the previous chapter, except that we have one extra section for nginx:
[watcher:web] cmd = runnerly-tokendealer --fd $(circus.sockets.web) use_sockets = True numprocesses = 5 copy_env = True [socket:web] host = 0.0.0.0 port = ...