Skip to content

Instantly share code, notes, and snippets.

@ashutosh1919
Created September 21, 2020 06:33
Show Gist options
  • Save ashutosh1919/ebba91851b66e1e22818c3fe88aff761 to your computer and use it in GitHub Desktop.
Save ashutosh1919/ebba91851b66e1e22818c3fe88aff761 to your computer and use it in GitHub Desktop.
docker-compose.yml file for Dockerized Flask + MongoDB application
app:
build: .
command: python -u app.py
ports:
- "5000:5000"
volumes:
- .:/app
links:
- db
db:
image: mongo:latest
hostname: test_mongodb
environment:
- MONGO_INITDB_DATABASE=animal_db
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=pass
volumes:
- ./init-db.js:/docker-entrypoint-initdb.d/init-db.js:ro
ports:
- 27017:27017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment