This commit is contained in:
tbphp
2025-06-06 21:45:01 +08:00
commit 219c068dbf
12 changed files with 2076 additions and 0 deletions

52
docker-compose.yml Normal file
View File

@@ -0,0 +1,52 @@
version: '3.8'
services:
openai-proxy:
build: .
container_name: openai-proxy-go
ports:
- "3000:3000"
volumes:
# 挂载密钥文件(只读)
- ./keys.txt:/app/keys.txt:ro
# 挂载配置文件(只读)
- ./.env:/app/.env:ro
restart: unless-stopped
# 健康检查
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
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