-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
300 lines (288 loc) · 8.44 KB
/
docker-compose.dev.yml
File metadata and controls
300 lines (288 loc) · 8.44 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
version: '3.8'
services:
# Main ContextLite Server
contextlite:
build:
context: .
dockerfile: docker/Dockerfile.dev
target: development
image: contextlite/contextlite:dev
container_name: contextlite-dev
ports:
- "8080:8080"
- "8083:8083" # Alternative port for development
- "40000:40000" # Delve debugger port
volumes:
- .:/app
- contextlite_dev_data:/app/data
- contextlite_cache:/app/cache
- /app/bin # Exclude binary from volume mount
environment:
- CONTEXTLITE_ENV=development
- CONTEXTLITE_LOG_LEVEL=debug
- CONTEXTLITE_HOST=0.0.0.0
- CONTEXTLITE_PORT=8080
- CONTEXTLITE_DATABASE=/app/data/contextlite.db
- CONTEXTLITE_CONFIG_PATH=/app/configs/default.yaml
- CONTEXTLITE_AUTH_TOKEN=${CONTEXTLITE_AUTH_TOKEN:-dev-token-12345}
- GO_ENV=development
- CGO_ENABLED=1
networks:
- contextlite-dev
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
clickhouse:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/v1/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
labels:
- "traefik.enable=true"
- "traefik.http.routers.contextlite-dev.rule=Host(`dev.contextlite.local`)"
- "traefik.http.routers.contextlite-dev.tls=true"
# Web Dashboard (Development)
dashboard:
build:
context: .
dockerfile: docker/Dockerfile.dashboard
target: development
image: contextlite/dashboard:dev
container_name: contextlite-dashboard-dev
ports:
- "3000:3000"
- "3001:3001" # API port
volumes:
- ./demo-site:/app
- dashboard_node_modules:/app/frontend/node_modules
- dashboard_api_modules:/app/backend/node_modules
environment:
- NODE_ENV=development
- PORT=3000
- API_PORT=3001
- CONTEXTLITE_API_URL=http://contextlite:8080
- NEXT_PUBLIC_API_URL=http://localhost:8080
- FRONTEND_URL=http://localhost:3000
- CORS_ORIGIN=http://localhost:3000
networks:
- contextlite-dev
depends_on:
- contextlite
command: ["npm", "run", "dev"]
labels:
- "traefik.enable=true"
- "traefik.http.routers.dashboard-dev.rule=Host(`dashboard.contextlite.local`)"
# PostgreSQL Database
postgres:
image: postgres:16-alpine
container_name: contextlite-postgres-dev
ports:
- "5432:5432"
volumes:
- postgres_dev_data:/var/lib/postgresql/data
- ./pkg/adapters/postgresql/schemas:/docker-entrypoint-initdb.d
- ./configs/postgres/postgresql.dev.conf:/etc/postgresql/postgresql.conf
environment:
- POSTGRES_DB=contextlite_dev
- POSTGRES_USER=contextlite
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-dev_password_123}
- POSTGRES_INITDB_ARGS=--auth-host=scram-sha-256
- POSTGRES_HOST_AUTH_METHOD=scram-sha-256
networks:
- contextlite-dev
command: ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]
healthcheck:
test: ["CMD-SHELL", "pg_isready -U contextlite -d contextlite_dev"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# Redis Cache and Pub/Sub
redis:
image: redis:7-alpine
container_name: contextlite-redis-dev
ports:
- "6379:6379"
volumes:
- redis_dev_data:/data
- ./configs/redis/redis.dev.conf:/usr/local/etc/redis/redis.conf
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD:-dev_redis_123}
networks:
- contextlite-dev
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
restart: unless-stopped
# ClickHouse Analytics Database
clickhouse:
image: clickhouse/clickhouse-server:24.1-alpine
container_name: contextlite-clickhouse-dev
ports:
- "8123:8123" # HTTP interface
- "9000:9000" # Native interface
volumes:
- clickhouse_dev_data:/var/lib/clickhouse
- clickhouse_dev_logs:/var/log/clickhouse-server
- ./configs/clickhouse/config.dev.xml:/etc/clickhouse-server/config.xml
- ./configs/clickhouse/users.dev.xml:/etc/clickhouse-server/users.xml
- ./pkg/adapters/clickhouse/schemas:/docker-entrypoint-initdb.d
environment:
- CLICKHOUSE_DB=contextlite_dev
- CLICKHOUSE_USER=contextlite
- CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD:-dev_clickhouse_123}
- CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1
networks:
- contextlite-dev
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8123/ping"]
interval: 10s
timeout: 5s
retries: 3
restart: unless-stopped
ulimits:
nofile:
soft: 262144
hard: 262144
# License Server (Development)
license-server:
build:
context: .
dockerfile: docker/Dockerfile.license-server
target: development
image: contextlite/license-server:dev
container_name: contextlite-license-dev
ports:
- "8081:8081"
volumes:
- license_dev_data:/app/data
- ./cmd/license-server:/app/src
environment:
- CONTEXTLITE_LICENSE_ENV=development
- CONTEXTLITE_LICENSE_PORT=8081
- CONTEXTLITE_LICENSE_DATABASE=/app/data/license_tracking.db
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY:-sk_test_dev}
- STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET:-whsec_dev}
networks:
- contextlite-dev
depends_on:
- postgres
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8081/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
# Development Reverse Proxy (Traefik)
traefik:
image: traefik:v3.0
container_name: contextlite-traefik-dev
ports:
- "80:80"
- "443:443"
- "8888:8080" # Dashboard
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- traefik_dev_certs:/certs
- ./configs/traefik/traefik.dev.yml:/etc/traefik/traefik.yml
- ./configs/traefik/dynamic.dev.yml:/etc/traefik/dynamic.yml
environment:
- TRAEFIK_API_DASHBOARD=true
- TRAEFIK_API_INSECURE=true
networks:
- contextlite-dev
restart: unless-stopped
profiles:
- proxy
# Development Tools Container
devtools:
image: alpine:latest
container_name: contextlite-devtools
volumes:
- .:/workspace
- contextlite_dev_data:/data
working_dir: /workspace
networks:
- contextlite-dev
command: ["tail", "-f", "/dev/null"]
profiles:
- tools
# Monitoring and Observability (Development)
prometheus:
image: prom/prometheus:latest
container_name: contextlite-prometheus-dev
ports:
- "9090:9090"
volumes:
- prometheus_dev_data:/prometheus
- ./configs/prometheus/prometheus.dev.yml:/etc/prometheus/prometheus.yml
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --web.console.libraries=/etc/prometheus/console_libraries
- --web.console.templates=/etc/prometheus/consoles
- --storage.tsdb.retention.time=200h
- --web.enable-lifecycle
networks:
- contextlite-dev
restart: unless-stopped
profiles:
- monitoring
grafana:
image: grafana/grafana:latest
container_name: contextlite-grafana-dev
ports:
- "3002:3000"
volumes:
- grafana_dev_data:/var/lib/grafana
- ./configs/grafana/provisioning:/etc/grafana/provisioning
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-dev_admin_123}
- GF_SERVER_ROOT_URL=http://localhost:3002
networks:
- contextlite-dev
depends_on:
- prometheus
restart: unless-stopped
profiles:
- monitoring
volumes:
contextlite_dev_data:
driver: local
contextlite_cache:
driver: local
postgres_dev_data:
driver: local
redis_dev_data:
driver: local
clickhouse_dev_data:
driver: local
clickhouse_dev_logs:
driver: local
license_dev_data:
driver: local
dashboard_node_modules:
driver: local
dashboard_api_modules:
driver: local
traefik_dev_certs:
driver: local
prometheus_dev_data:
driver: local
grafana_dev_data:
driver: local
networks:
contextlite-dev:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16