2026-05-20 07:01:08 +00:00
|
|
|
|
# 本機開發依賴:MongoDB(notification 持久化)、Redis(冪等/配額/異步重試/member OTP)
|
|
|
|
|
|
#
|
|
|
|
|
|
# 啟動:make deps-up
|
|
|
|
|
|
# 設定:etc/gateway.dev.yaml(搭配 make run-dev)
|
|
|
|
|
|
# 索引:首次啟動由 deploy/mongo/init 建立;既有 volume 可執行 make mongo-index
|
|
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
|
mongo:
|
|
|
|
|
|
image: mongo:7
|
|
|
|
|
|
container_name: gateway-mongo
|
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
ports:
|
|
|
|
|
|
- "27017:27017"
|
|
|
|
|
|
environment:
|
|
|
|
|
|
MONGO_INITDB_DATABASE: gateway
|
|
|
|
|
|
volumes:
|
|
|
|
|
|
- mongo_data:/data/db
|
|
|
|
|
|
- ./deploy/mongo/init:/docker-entrypoint-initdb.d:ro
|
|
|
|
|
|
healthcheck:
|
|
|
|
|
|
test: ["CMD", "mongosh", "--quiet", "--eval", "db.adminCommand('ping').ok"]
|
|
|
|
|
|
interval: 5s
|
|
|
|
|
|
timeout: 5s
|
|
|
|
|
|
retries: 10
|
|
|
|
|
|
start_period: 10s
|
|
|
|
|
|
|
|
|
|
|
|
redis:
|
|
|
|
|
|
image: redis:7-alpine
|
|
|
|
|
|
container_name: gateway-redis
|
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
ports:
|
|
|
|
|
|
- "6379:6379"
|
|
|
|
|
|
command: ["redis-server", "--appendonly", "yes"]
|
|
|
|
|
|
volumes:
|
|
|
|
|
|
- redis_data:/data
|
|
|
|
|
|
healthcheck:
|
|
|
|
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
|
|
|
|
interval: 5s
|
|
|
|
|
|
timeout: 3s
|
|
|
|
|
|
retries: 10
|
|
|
|
|
|
|
2026-05-20 09:32:22 +00:00
|
|
|
|
mailhog:
|
|
|
|
|
|
profiles: ["smtp"]
|
|
|
|
|
|
image: mailhog/mailhog:v1.0.1
|
|
|
|
|
|
container_name: gateway-mailhog
|
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
ports:
|
|
|
|
|
|
- "1025:1025" # SMTP
|
|
|
|
|
|
- "8025:8025" # Web UI
|
|
|
|
|
|
|
2026-05-20 07:01:08 +00:00
|
|
|
|
volumes:
|
|
|
|
|
|
mongo_data:
|
|
|
|
|
|
redis_data:
|