- 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:
forked from fromzeroedu/docker-compose-mongodb
-
Notifications
You must be signed in to change notification settings - Fork 0
dhaniboy09/docker-compose-mongodb
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Python 100.0%