更新 opencode/docker-compose.yaml

This commit is contained in:
wol
2026-07-03 15:50:01 +08:00
parent f8791e401d
commit 1ac15c6fe4
+12 -13
View File
@@ -1,35 +1,34 @@
services:
opencode:
image: ghcr.io/anomalyco/opencode:latest
build:
context: .
dockerfile: Dockerfile
image: opencode-jdk:latest
container_name: opencode
restart: unless-stopped
# 关键:强制以 Web 模式启动,必须使用 --hostname 0.0.0.0[reference:2][reference:3]
entrypoint: ["opencode", "web", "--hostname", "0.0.0.0", "--port", "3000"]
entrypoint:
- opencode
- web
- --hostname
- 0.0.0.0
- --port
- "3000"
ports:
# 将宿主机 3004 端口映射到容器的 3000 端口[reference:4]
- "3004:3000"
volumes:
# 持久化配置 (API密钥、设置等)
- /home/wol/docker-data/opencode/config:/root/.opencode
# 工作目录,存放代码项目
- /home/wol/docker-data/jupyter/data/opencode:/workspace
environment:
# 设置 AI 的工作目录
- WORKDIR=/workspace
# 可选:国内 npm 加速
- NPM_CONFIG_REGISTRY=https://registry.npmmirror.com
# 可选:设置 Git 用户信息,防止 AI 提交代码时报错
- GIT_AUTHOR_NAME=opencode
- GIT_AUTHOR_EMAIL=opencode@w2ming.cn
# 可选:如果需要通过代理访问 API,取消注释并填写代理地址
# - HTTP_PROXY=http://192.168.x.x:7890
# - HTTPS_PROXY=http://192.168.x.x:7890
# 可选:创建一个自定义网络
networks:
- 1panel-network