Member-only story
Create a Running Docker Container With Gunicorn and Flask
The simplest container setup imaginable. Start here
Published in
2 min readNov 4, 2020
Let’s begin by creating a minimal Flask application:
Next, let’s write the command that will run the Gunicorn server:
The parameters are pretty much self-explanatory: We are telling Gunicorn that we want to spawn two worker processes running two threads each. We are also accepting connections from the outside and overriding Gunicorn’s default port (8000).
Our basic Dockerfile: