Row-proxy / docker-compose.prod.yml
justincnn
Add Docker build workflow and compose configurations
629a8be
raw
history blame
1.25 kB
version: '3.8'
services:
zai-proxy:
image: your-dockerhub-username/zai-proxy:latest
container_name: zai-proxy
restart: unless-stopped
ports:
- "8080:8080"
environment:
# 服务配置
- PORT=8080
- LOG_LEVEL=info
# 上游服务配置
- UPSTREAM_URL=https://api.anthropic.com
- UPSTREAM_API_KEY=${UPSTREAM_API_KEY}
# 认证配置(可选)
# - AUTH_TYPE=jwt
# - JWT_SECRET=${JWT_SECRET}
# 代理配置(可选)
# - HTTP_PROXY=http://proxy.example.com:8080
# - HTTPS_PROXY=http://proxy.example.com:8080
# 健康检查
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# 资源限制
deploy:
resources:
limits:
cpus: '1'
memory: 512M
reservations:
cpus: '0.5'
memory: 256M
# 日志配置
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# 网络配置
networks:
- zai-network
networks:
zai-network:
driver: bridge