add mongo

This commit is contained in:
Jeremy Yin 2024-03-14 16:39:23 +08:00
parent 8ee97059e5
commit 233f80d25f
1 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,47 @@
version: "3"
services:
mongodb:
image: mongo:7.0.6
restart: always
volumes:
- "./data/mongo/configdb:/data/configdb"
- "./data/mongo/db:/data/db"
environment:
TZ: "Asia/Shanghai"
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
ports:
- 27017:27017
tty: true
stdin_open: true
networks:
- simplylab
logging:
driver: "json-file"
options:
max-size: "2m"
max-file: "10"
mongo-express:
image: mongo-express:1.0.2
restart: always
ports:
- 8081:8081
environment:
TZ: "Asia/Shanghai"
ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_USERNAME}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_PASSWORD}
ME_CONFIG_MONGODB_URL: mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@mongodb:27017/
tty: true
stdin_open: true
networks:
- simplylab
logging:
driver: "json-file"
options:
max-size: "2m"
max-file: "10"
networks:
simplylab: