This commit is contained in:
awei
2025-06-15 17:13:26 +08:00
parent 21f4026106
commit cb8fe9f52e
11 changed files with 153 additions and 210 deletions

View File

@@ -0,0 +1,23 @@
version: '3.8'
services:
mongodb:
image: mongodb/mongodb-community-server:7.0-ubuntu2204
container_name: mongodb
environment:
MONGODB_INITDB_ROOT_USERNAME: root
MONGODB_INITDB_ROOT_PASSWORD: 123456
TZ: Asia/Shanghai
ports:
- "27017:27017"
volumes:
- ./data:/data/db
- ./config:/etc/mongo
- ./logs:/var/log/mongodb
command: mongod --bind_ip_all
restart: unless-stopped
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 10s
retries: 5
start_period: 30s