-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
91 lines (86 loc) · 3.2 KB
/
docker-compose.yml
File metadata and controls
91 lines (86 loc) · 3.2 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
services:
# ── Database ────────────────────────────────────────────────
postgres:
image: postgres:16-alpine
container_name: cliproxy-postgres
environment:
POSTGRES_USER: cliproxy
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: cliproxy
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init-db:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -h localhost -U cliproxy -d cliproxy"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
restart: unless-stopped
# ── REST API layer (read-only, anonymous) ───────────────────
postgrest:
image: postgrest/postgrest:v12.2.3
container_name: cliproxy-postgrest
environment:
PGRST_DB_URI: postgres://cliproxy:${DB_PASSWORD}@postgres:5432/cliproxy
PGRST_DB_ANON_ROLE: web_anon
PGRST_DB_SCHEMA: public
PGRST_LOG_LEVEL: warn
PGRST_SERVER_PORT: 3000
ports:
- "127.0.0.1:${POSTGREST_HOST_PORT:-8418}:3000" # Dev only: expose for Vite proxy
depends_on:
postgres:
condition: service_healthy
collector:
condition: service_healthy
restart: unless-stopped
# ── Collector: polls CLIProxy, writes to postgres ───────────
collector:
image: ghcr.io/leolionart/cliproxy-collector:latest
platform: linux/amd64
container_name: cliproxy-collector
environment:
DATABASE_URL: postgres://cliproxy:${DB_PASSWORD}@postgres:5432/cliproxy
CLIPROXY_URL: ${CLIPROXY_URL:-http://host.docker.internal:8317}
CLIPROXY_MANAGEMENT_KEY: ${CLIPROXY_MANAGEMENT_KEY}
COLLECTOR_INTERVAL_SECONDS: ${COLLECTOR_INTERVAL_SECONDS:-300}
COLLECTOR_TRIGGER_PORT: 5001
TIMEZONE_OFFSET_HOURS: ${TIMEZONE_OFFSET_HOURS:-7}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
ADMIN_SESSION_TTL_DAYS: ${ADMIN_SESSION_TTL_DAYS:-30}
ADMIN_SESSION_COOKIE_NAME: ${ADMIN_SESSION_COOKIE_NAME:-cliproxy_admin_session}
ADMIN_SESSION_SECURE_COOKIE: ${ADMIN_SESSION_SECURE_COOKIE:-false}
ADMIN_SESSION_SAMESITE: ${ADMIN_SESSION_SAMESITE:-Lax}
ADMIN_ALLOWED_ORIGINS: ${ADMIN_ALLOWED_ORIGINS:-}
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5001/api/collector/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
labels:
com.centurylinklabs.watchtower.enable: "true"
# ── Frontend: nginx proxies /rest/v1 → postgrest, /api → collector
frontend:
image: ghcr.io/leolionart/cliproxy-dashboard:latest
platform: linux/amd64
container_name: cliproxy-dashboard
ports:
- "${DASHBOARD_PORT:-8417}:80"
depends_on:
collector:
condition: service_healthy
postgrest:
condition: service_started
restart: unless-stopped
labels:
com.centurylinklabs.watchtower.enable: "true"
volumes:
postgres_data: