2024-02-04 17:27:41 +08:00
|
|
|
version: "3.8"
|
2023-08-03 23:18:15 +08:00
|
|
|
|
|
|
|
services:
|
|
|
|
mongodb:
|
|
|
|
image: mongo
|
|
|
|
hostname: mongodb
|
|
|
|
container_name: mongodb
|
|
|
|
restart: always
|
|
|
|
ports:
|
|
|
|
- 27017:27017
|
|
|
|
volumes:
|
|
|
|
- mongodb_data:/data/db
|
|
|
|
environment:
|
|
|
|
- MONGO_INITDB_ROOT_USERNAME=admin
|
|
|
|
- MONGO_INITDB_ROOT_PASSWORD=mongodb27017
|
|
|
|
networks:
|
2024-02-04 17:27:41 +08:00
|
|
|
- mongodb_network
|
|
|
|
- diyue-network
|
2023-08-03 23:18:15 +08:00
|
|
|
mongo-express:
|
|
|
|
image: mongo-express
|
|
|
|
hostname: mongo-express
|
|
|
|
container_name: mongo-express
|
|
|
|
restart: always
|
|
|
|
ports:
|
|
|
|
- 8088:8081
|
|
|
|
environment:
|
|
|
|
- ME_CONFIG_MONGODB_ADMINUSERNAME=admin
|
|
|
|
- ME_CONFIG_MONGODB_ADMINPASSWORD=mongodb27017
|
|
|
|
- ME_CONFIG_MONGODB_SERVER=mongodb
|
|
|
|
networks:
|
|
|
|
mongodb_network:
|
|
|
|
|
|
|
|
networks:
|
|
|
|
mongodb_network:
|
|
|
|
driver: bridge
|
2024-02-04 17:27:41 +08:00
|
|
|
diyue-network:
|
|
|
|
driver: overlay
|
|
|
|
attachable: true
|
2023-08-03 23:18:15 +08:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
mongodb_data:
|
|
|
|
driver: local
|
|
|
|
|
|
|
|
|