Minimal setup for building a Python API running with Flask and MongoDB, inside Docker Containers. Some more info can be found in this medium post.
Make sure Docker and Docker Compose are installed, and then simply run:
docker-compose up --build -d
You can test the endpoints with:
curl localhost:5000 # Hello World
curl localhost:5000/users # Retrieves all users
curl --data "name=John Doe" localhost:5000/users # Adds new "John Doe" user
For unit testing, pip install pytest pytest-cov
and then you can run:
make test