# 本地开发 + 部署模板 # # 用法: # docker compose up --build 启动 server(端口 8000) # docker compose down 停止 # # 生产部署时把这一份拷到部署服务器,根据实际域名/Origin 改环境变量。 services: server: build: context: . dockerfile: packages/server/Dockerfile image: tts-like-server:latest container_name: tts-like-server restart: unless-stopped ports: - "8000:8000" environment: NODE_ENV: production PORT: 8000 # 生产改成你的真实域名(逗号分隔) ALLOWED_ORIGINS: "https://play.example.com,https://www.example.com" healthcheck: test: ["CMD", "wget", "-qO-", "http://localhost:8000/healthz"] interval: 30s timeout: 5s retries: 3 # 反向代理假设:Nginx/Caddy 终止 TLS,转发到 host:8000 # wss://play.example.com -> ws://server:8000