Files

33 lines
1.1 KiB
YAML
Raw Permalink Normal View History

services:
moltbot:
container_name: moltbot-prod
image: xxx.xuanyuan.run/moltbot/moltbot:v1.0.0 # 锁定稳定版本
restart: unless-stopped
user: "1000:1000"
ports:
- "127.0.0.1:18789:18789"
- "127.0.0.1:18791:18791"
volumes:
- /data/moltbot:/home/moltbot/.clawdbot
- /data/moltbot/logs:/home/moltbot/.clawdbot/logs
- /data/moltbot/credentials:/home/moltbot/.clawdbot/credentials
env_file:
- .env.moltbot
# 资源限制配置注意非Swarm模式下deploy.resources不生效
deploy:
resources:
limits:
cpus: '4'
memory: 8G
# 健康检查兼容无curl场景修正CMD语法风险采用CMD-SHELL支持shell运算符
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:18789/health >/dev/null || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s # 给服务启动预留时间
# 非Swarm模式资源限制补充mem_limit/cpus 兼容普通docker compose
mem_limit: 8g
memswap_limit: 8g
cpus: '4'