Files
deploy.stack/moltbot/stack.yml
cnphpbb b39a28236a build(moltbot): 添加生产环境docker compose配置文件
添加moltbot的生产环境docker compose配置文件,包含容器配置、资源限制和健康检查
2026-02-02 17:23:06 +08:00

33 lines
1.1 KiB
YAML
Raw Permalink 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:
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'