version: "3.5"
services:
mongodb:
image: mongo
container_name: mongodb
restart: on-failure
ports:
- 27017:27017
environment:
TZ: Asia/Shanghai
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: 123456
volumes:
- ./database:/data/db
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
mongo-express:
image: mongo-express
container_name: mongo-express
ports:
- 27018:8081
environment:
ME_CONFIG_OPTIONS_EDITORTHEME: 3024-night
ME_CONFIG_MONGODB_SERVER: mongodb
ME_CONFIG_MONGODB_ADMINUSERNAME: admin
ME_CONFIG_MONGODB_ADMINPASSWORD: 123456
ME_CONFIG_BASICAUTH_USERNAME: admin
ME_CONFIG_BASICAUTH_PASSWORD: 123456
depends_on:
- mongodb
docker-compose mongo
于 2024-03-13 16:15:01 首次发布