Spaces:
Paused
Paused
File size: 1,250 Bytes
629a8be | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | 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
|