guestbooky/build/docker-compose.local.yml
Felipe Cotti a2e1d45661
Some checks failed
CI/CD / build-and-test (push) Has been cancelled
fix: We still had places to improve. Turns out this is pretty important.
2024-12-05 15:14:17 -03:00

33 lines
No EOL
1,017 B
YAML

services:
mongo:
image: mongo
container_name: mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
volumes:
- ./mongodb/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
- ./mongodb/mongod.conf:/etc/mongod.conf:ro
- mongodata:/data/db
command: ["mongod", "--config", "/etc/mongod.conf"]
ports:
- "127.0.0.1:27017:27017"
mongo-express:
image: mongo-express
container_name: mongo-express
restart: always
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_INITDB_ROOT_USERNAME}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
ME_CONFIG_MONGODB_URL: mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@mongo:27017/
ME_CONFIG_BASICAUTH: "true"
depends_on:
- mongo
ports:
- "127.0.0.1:8082:8081"
volumes:
mongodata: