Skip to Content
Python Microservices Development
book

Python Microservices Development

by Tarek Ziadé
July 2017
Beginner to intermediate
340 pages
7h 43m
English
Packt Publishing
Content preview from Python Microservices Development

Circus

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 = ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Microservices Development - Second Edition

Python Microservices Development - Second Edition

Simon Fraser, Tarek Ziadé
Python Web Development with Sanic

Python Web Development with Sanic

Stephen Sadowski, Adam Hopkins

Publisher Resources

ISBN: 9781785881114Supplemental Content