An example Flask app using Python 3 and Docker.
Docker : docker run -p 8080:8080 -it garyjyao/flask-app-example:main
What's in the box?
- Ubuntu Linux based Docker image
- SSL/TLS listener
- Modular route handlers using Flask Blueprints
- Gunicorn WSGI server
- Flask tests (under
tests
directory) usingpytest
and asmoke-tests.py
for basic endpoint testing
Install Python dependencies:
make install-deps
To build the app:
make all
This does a couple of things:
- It generates self-signed SSL certificates (
server.key
andserver.crt
) - It generates
server_info.json
that is served by the/server_info
endpoint - It runs tests using
pytest
- It generates a Docker image
Explore the Makefile
for details.
To run the app in Docker:
make run
To run the app directly without using Docker:
make run-app-dev-mode
make run-app-dev-mode-ssl
make smoke-tests
Please raise issue or pull request. Thanks for contributing!
Have fun!