forked from su-kaka/gcli2api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
20 lines (19 loc) · 796 Bytes
/
docker-compose.yml
File metadata and controls
20 lines (19 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
version: '3.8'
services:
gcli2api:
image: ghcr.io/cetaceang/gcli2api:latest
container_name: gcli2api
restart: unless-stopped
network_mode: host
environment:
- PASSWORD=pwd
- PORT=7861
# - GOOGLE_CREDENTIALS=${GOOGLE_CREDENTIALS} # 可选:从环境变量传入凭证
volumes:
- ./data/creds:/app/geminicli/creds
healthcheck:
test: ["CMD-SHELL", "python -c \"import sys, urllib.request, os; port = os.environ.get('PORT', '7861'); req = urllib.request.Request(f'http://localhost:{port}/v1/models', headers={'Authorization': 'Bearer ' + os.environ.get('PASSWORD', 'pwd')}); sys.exit(0 if urllib.request.urlopen(req, timeout=5).getcode() == 200 else 1)\""]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s