Created
September 17, 2022 16:53
-
-
Save asafedainez/d06991a561355d5c68b70153f0b966c6 to your computer and use it in GitHub Desktop.
Docker compose Mongo com mongo express
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.5' | |
services: | |
mongo: | |
image: mongo:5.0.10 | |
container_name: mongo | |
# volumes: | |
# - ./db_data:/data/db | |
ports: | |
- 27017:27017 | |
environment: | |
MONGO_INITDB_ROOT_USERNAME: root | |
MONGO_INITDB_ROOT_PASSWORD: root | |
networks: | |
- default | |
healthcheck: | |
test: echo 'db.runCommand("ping").ok' | mongo mongo:27017/test --quiet | |
interval: 2s | |
timeout: 2s | |
start_period: 5s | |
retries: 5 | |
mongo-express: | |
image: mongo-express | |
container_name: mongo-express | |
ports: | |
- 8081:8081 | |
networks: | |
- default | |
depends_on: | |
mongo: | |
condition: service_healthy | |
environment: | |
ME_CONFIG_MONGODB_ADMINUSERNAME: root | |
ME_CONFIG_MONGODB_ADMINPASSWORD: root | |
ME_CONFIG_MONGODB_URL: mongodb://root:root@mongo:27017/ | |
networks: | |
default: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment