feat: 优化配置

This commit is contained in:
tbphp
2025-06-07 00:04:02 +08:00
parent adcaa4d910
commit 9ba7375f9c
3 changed files with 59 additions and 46 deletions

View File

@@ -1,9 +1,9 @@
version: '3.8'
version: "3.8"
services:
openai-proxy:
gpt-load:
build: .
container_name: openai-proxy-go
container_name: gpt-load
ports:
- "3000:3000"
volumes:
@@ -12,7 +12,7 @@ services:
# 挂载配置文件(只读)
- ./.env:/app/.env:ro
restart: unless-stopped
# 健康检查
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
@@ -20,33 +20,6 @@ services:
timeout: 10s
retries: 3
start_period: 40s
# 环境变量
environment:
- GO_ENV=production
# 日志配置
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# 资源限制
deploy:
resources:
limits:
memory: 512M
cpus: '1.0'
reservations:
memory: 128M
cpus: '0.25'
# 网络配置
networks:
- proxy-network
# 网络定义
networks:
proxy-network:
driver: bridge
env_file:
- .env