Files
openteam/docker-compose.yml
T
SakurasanandClaude 8495694671 构建: 入口脚本 chown 数据目录后降权运行
绑定挂载/命名卷被 docker 以 root 自动创建时,容器非 root 用户
写不进 db(SQLITE_CANTOPEN)。改为 entrypoint 以 root 启动,
chown 数据目录到 OT_UID:OT_GID(默认 1000:1000)后 su-exec 降权,
compose 不再需要 user: 覆盖。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-18 22:25:43 +08:00

41 lines
1.4 KiB
YAML
Raw 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.
# openteam 自托管部署
#
# 启动:docker compose up -d
# 首次会本地构建镜像(见 Dockerfile);若已用 build-image.sh 推到仓库,
# 把 image 改为仓库地址并删掉 build 段即可拉取多架构镜像。
#
# 密钥从仓库根 .env 读取(与本地开发共用),缺失时 compose 直接报错。
name: openteam
services:
openteam:
build:
context: .
dockerfile: Dockerfile
image: openteam:latest
container_name: openteam
restart: unless-stopped
ports:
- "${HOST_PORT:-8080}:8080"
environment:
OT_ENV: production
OT_PORT: 8080
# sqlite 落盘到当前目录 ./data(容器 WORKDIR=/app,DSN 用相对路径)
OT_DB_DRIVER: sqlite
OT_DB_DSN: data/openteam.db
# 必填密钥:渠道加密主密钥 / 管理员密码 / JWT 签名
OT_MASTER_KEY: ${OT_MASTER_KEY:?请在 .env 中设置 OT_MASTER_KEY}
OT_ADMIN_PASSWORD: ${OT_ADMIN_PASSWORD:?请在 .env 中设置 OT_ADMIN_PASSWORD}
OT_JWT_SECRET: ${OT_JWT_SECRET:?请在 .env 中设置 OT_JWT_SECRET}
# 入口脚本据此 chown 数据目录并降权运行(默认 1000:1000)
OT_UID: "${OT_UID:-1000}"
OT_GID: "${OT_GID:-1000}"
volumes:
- ./data:/app/data
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8080/healthz"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s