Repository navigation
Expand file tree
/
Copy pathdocker-compose.local.yml
More file actions
170 lines (163 loc) · 5.08 KB
/
Copy pathdocker-compose.local.yml
File metadata and controls
170 lines (163 loc) · 5.08 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# Local setup for macOS / Windows (Docker Desktop)
# No Caddy, no TLS, no systemd — everything on localhost
# Usage: docker compose -f docker-compose.local.yml up -d
services:
postgres:
image: postgres:16-alpine
container_name: cliproxyapi-postgres
restart: unless-stopped
networks:
- backend
environment:
POSTGRES_DB: cliproxyapi
POSTGRES_USER: cliproxyapi
# NOTE: Only used on first run (volume creation). Changing this later won't update the DB password.
# To reset: docker compose -f docker-compose.local.yml down -v
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U cliproxyapi -d cliproxyapi"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# Requires ./config.local.yaml mounted below with `port: 8317` for management/OAuth
cliproxyapi:
image: eceasy/cli-proxy-api:${CLIPROXYAPI_IMAGE_TAG:-v8.0.29}
container_name: cliproxyapi
restart: unless-stopped
networks:
- frontend
- backend
environment:
MANAGEMENT_PASSWORD: ${MANAGEMENT_API_KEY}
DEPLOY: production
CLIPROXY_TELEGRAM_BOT_TOKEN: ${CLIPROXY_TELEGRAM_BOT_TOKEN:-}
CLIPROXY_TELEGRAM_ALLOWED_USERS: ${CLIPROXY_TELEGRAM_ALLOWED_USERS:-}
ports:
- "127.0.0.1:8317:8317"
- "127.0.0.1:8085:8085"
- "127.0.0.1:1455:1455"
- "127.0.0.1:54545:54545"
- "127.0.0.1:51121:51121"
- "127.0.0.1:11451:11451"
volumes:
- ./config.local.yaml:/CLIProxyAPI/config.yaml
- cliproxyapi_auths:/root/.cli-proxy-api
- cliproxyapi_logs:/CLIProxyAPI/logs
- cliproxyapi_plugins:/CLIProxyAPI/plugins
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "bash", "-c", "echo > /dev/tcp/localhost/8317"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
docker-proxy:
image: tecnativa/docker-socket-proxy:latest
container_name: cliproxyapi-docker-proxy
restart: unless-stopped
networks:
- backend
environment:
CONTAINERS: 1
IMAGES: 1
POST: 1
NETWORKS: 0
VOLUMES: 0
EXEC: 0
SERVICES: 0
SWARM: 0
NODES: 0
BUILD: 0
COMMIT: 0
CONFIGS: 0
SECRETS: 0
PLUGINS: 0
SYSTEM: 0
TASKS: 0
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
healthcheck:
test: ["CMD-SHELL", "wget --spider -q http://localhost:2375/_ping || exit 1"]
interval: 15s
timeout: 5s
retries: 3
start_period: 5s
# Perplexity Pro Sidecar — only starts when COMPOSE_PROFILES includes "perplexity"
# Enable via: ./setup-local.sh (answer 'y' to Perplexity prompt)
perplexity-sidecar:
profiles: ["perplexity"]
build: ./perplexity-sidecar
container_name: cliproxyapi-perplexity-sidecar
restart: unless-stopped
networks:
- frontend
- backend
environment:
PERPLEXITY_COOKIES: ${PERPLEXITY_COOKIES:-}
PERPLEXITY_SIDECAR_SECRET: ${PERPLEXITY_SIDECAR_SECRET:-}
MANAGEMENT_API_KEY: ${MANAGEMENT_API_KEY}
DASHBOARD_URL: http://dashboard:3000
PORT: "8766"
PERPLEXITY_SIDECAR_AUTO_UPDATE: ${PERPLEXITY_SIDECAR_AUTO_UPDATE:-true}
UPDATE_CHECK_INTERVAL: ${UPDATE_CHECK_INTERVAL:-3600}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8766/health"]
interval: 15s
timeout: 5s
retries: 3
start_period: 10s
dashboard:
build: ./dashboard
container_name: cliproxyapi-dashboard
restart: unless-stopped
networks:
- frontend
- backend
ports:
- "127.0.0.1:3000:3000"
environment:
DATABASE_URL: postgresql://cliproxyapi:${POSTGRES_PASSWORD}@postgres:5432/cliproxyapi
CLIPROXYAPI_MANAGEMENT_URL: http://cliproxyapi:8317/v0/management
MANAGEMENT_API_KEY: ${MANAGEMENT_API_KEY}
JWT_SECRET: ${JWT_SECRET}
NODE_ENV: production
DOCKER_HOST: tcp://docker-proxy:2375
DASHBOARD_URL: http://localhost:3000
API_URL: http://localhost:8317
ALLOW_LOCAL_PROVIDER_URLS: ${ALLOW_LOCAL_PROVIDER_URLS:-false}
volumes:
# Writable so the in-app updater can pin CLIPROXYAPI_IMAGE_TAG
- ./.env:/opt/cliproxyapi/host.env
- dashboard_backups:/app/backups
depends_on:
postgres:
condition: service_healthy
cliproxyapi:
condition: service_healthy
docker-proxy:
condition: service_healthy
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:3000/api/health').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"]
interval: 15s
timeout: 10s
retries: 3
start_period: 40s # Allow time for DB init + Next.js startup
volumes:
postgres_data:
cliproxyapi_auths:
cliproxyapi_logs:
cliproxyapi_plugins:
dashboard_backups:
networks:
frontend:
driver: bridge
name: cliproxyapi_frontend
backend:
driver: bridge
name: cliproxyapi_backend
internal: true # Match production — no external internet access