Flask Hello world project ready with docker

May 20, 2022 ยท View on GitHub

Tiny demo project that run a Flask hello app :

  • locally with Flask command (dev)
  • locally with Gunicorn (test)
  • locally or on server with Gunicorn inside Docker (prod)

Run the app

locally

Run the following commands :

make setup # only once
make generate-selfsigned-cert # only once

make run-dev # dev mode (Flask)
make run-prod # test mode (Gunicorn)
make run # prod mode (Gunicorn inside Docker)

on server

Run the following command :

make run # prod mode (Gunicorn inside Docker)

Stop the service :

docker-compose down

Check result