Files
billai/docker-compose.yaml
2026-01-08 23:42:01 +08:00

44 lines
1.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
mongodb:
image: mongo:8.0
container_name: billai-mongodb
restart: unless-stopped
ports:
- "27017:27017"
environment:
MONGO_INITDB_DATABASE: billai
# 如需认证,取消下面两行注释
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: password
volumes:
- ./mongo/data/db:/data/db
- ./mongo/data/configdb:/data/configdb
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
default:
aliases:
- mongo
# 可选MongoDB 可视化管理工具
mongo-express:
image: mongo-express:latest
container_name: billai-mongo-express
restart: unless-stopped
ports:
- "8083:8081"
environment:
ME_CONFIG_MONGODB_SERVER: mongodb
ME_CONFIG_MONGODB_PORT: 27017
ME_CONFIG_BASICAUTH: "false"
# 如启用 MongoDB 认证,取消下面两行注释
ME_CONFIG_MONGODB_ADMINUSERNAME: admin
ME_CONFIG_MONGODB_ADMINPASSWORD: password
depends_on:
mongodb:
condition: service_healthy