- In this case we're going to do an application factory with Blueprints
- Clone the app
- Note that I'm using different container names in docker-compose.yml to avoid conflicts
- Build the image with
docker-compose build
- Run the container with
docker-compose up
- Hit
/
and see the counter incrementing every time you refresh the page - To explore the mongodb database, open a new tab and do
docker exec -it counterapp_db_2 mongo
- Do
use counter
,show collections
,db.counter.find()
- Do
- To run tests, do
docker exec -it counterapp_web_2 python tests.py
- Using PDB with Docker Compose
- Start the database as it's own demon service:
docker-compose up -d db
- Now start the application with pdb enabled:
docker-compose run --service-ports web
- You will get the live log of just the app and you can stop with CTRL-C
- Try adding a pdb on the code
- To stop the db
docker-compose stop db
- Start the database as it's own demon service:
erfederuiz / docker-compose-mongodb Goto Github PK
View Code? Open in Web Editor NEWThis project forked from fromzeroedu/docker-compose-mongodb