# ===== openteam 单实例部署(nginx + api + postgres)===== # 使用:cp .env.example ../.env 并修改密钥,然后 docker compose up -d services: api: build: context: .. dockerfile: deploy/Dockerfile.api restart: unless-stopped environment: OT_ENV: production OT_PORT: "8080" OT_DB_DRIVER: postgres OT_DB_DSN: host=postgres user=openteam password=${OT_DB_PASSWORD:-openteam} dbname=openteam port=5432 sslmode=disable OT_JWT_SECRET: ${OT_JWT_SECRET:?set in .env} OT_MASTER_KEY: ${OT_MASTER_KEY:?set in .env} OT_ADMIN_PASSWORD: ${OT_ADMIN_PASSWORD:-admin123} OT_PROXY_UPSTREAM_KEY: ${OT_PROXY_UPSTREAM_KEY:-} OT_PROXY_UPSTREAM_BASE_URL: ${OT_PROXY_UPSTREAM_BASE_URL:-https://api.openai.com} OT_PROXY_DEFAULT_MODEL: ${OT_PROXY_DEFAULT_MODEL:-gpt-4o-mini} depends_on: postgres: condition: service_healthy # 预留 Redis(M6 限流);当前单实例不依赖 # redis: # image: redis:7-alpine # restart: unless-stopped postgres: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_USER: openteam POSTGRES_PASSWORD: ${OT_DB_PASSWORD:-openteam} POSTGRES_DB: openteam volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U openteam"] interval: 5s timeout: 3s retries: 10 web: build: context: .. dockerfile: deploy/Dockerfile.web restart: unless-stopped ports: - "${OT_HTTP_PORT:-80}:80" depends_on: - api volumes: pgdata: