What's in your Flask? It could be Whiskey or Gin 🍸. But if it's an API in need of some TLC to reach it's true potential 🚀, then this is what you need!
Instantly turn your Python-Flask application into a production-ready docker container.
No more writing and maintaining Dockerfile
or docker-compose
Automatically adds and configures the following in your container so you don't have to:
- gunicorn for scalability
- nginx for routing
- supervisord for monitoring
Place your files inside /app
.
Get up and running with a single command:
docker-compose up
Now, if anyone asks you to quickly create and deploy a scalable Flask app, all you have to say is "Hold My FLASK"!
- Place your Flask app files into the
app
directory. Use the nameapp.py
for your app's entry point or change the filename inconfigs/supervisord.conf
. (skip to step #5 to use defaults) - Set the version tag on the first line of
Dockerfile
to your desired Python version. (3.9 by default) - (Optional) Make changes to gunicorn, nginx and supervisord config files in
/configs
as needed. - (Optional) Use a file "
app/utils/prep.py
" to run python setup scripts such as downloading sklearn models and uncomment the respective line inDockerfile
to run the scripts before starting the server. - Finally, run the following set of command to build and run the docker container:
docker-compose up