add docker compose.yml, env example and gitignore file

This commit is contained in:
tao.chen
2026-06-18 14:34:03 +08:00
parent b499f5fb34
commit ad83c2626b
3 changed files with 60 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
# OpenCode 服务环境变量模板
# 复制本文件为 .env 并填入真实值;.env 不要提交到仓库。
# Web 服务登录密码。生产环境必须改为强密码并通过 secret manager 注入。
OPENCODE_SERVER_PASSWORD=change-me
+28
View File
@@ -0,0 +1,28 @@
# Environment / secrets — never commit real env files
.env
.env.local
.env.*.local
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
.venv/
venv/
ENV/
# Editor / IDE
.vscode/
.idea/
*.swp
*.swo
# OS
.DS_Store
Thumbs.db
# Logs
*.log
logs/
+27
View File
@@ -0,0 +1,27 @@
services:
opencode:
container_name: opencode
build: .
image: opencode:latest
ports:
- "14096:4096"
environment:
# Set OPENCODE_SERVER_PASSWORD in .env or your shell environment before `docker compose up`.
OPENCODE_SERVER_PASSWORD: ${OPENCODE_SERVER_PASSWORD}
volumes:
- /root/.config/opencode:/root/.config/opencode
- /root/.local/share/opencode:/root/.local/share/opencode
- /root/OpenCode:/root/workspace
command:
- web
- --hostname
- 0.0.0.0
- --mdns
- --port
- "4096"
- --print-logs
- --log-level
- DEBUG
tty: true
stdin_open: true
restart: unless-stopped