-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
88 lines (84 loc) · 2.21 KB
/
docker-compose.yml
File metadata and controls
88 lines (84 loc) · 2.21 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
services:
# Server component - handles API requests
server:
image: ghcr.io/kjanat/chatlogger-api-server:${VERSION:-latest}
ports:
- "8080:8080"
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
environment:
- DATABASE_URL=postgresql://dbuser:dbpassword@db:5432/chatlogger
- REDIS_ADDR=redis:6379
- HOST=0.0.0.0
- PORT=8080
- JWT_SECRET=${JWT_SECRET:-your-jwt-secret-replace-in-production}
- EXPORT_DIR=/app/exports
restart: unless-stopped
volumes:
- ./migrations:/app/migrations
- cl_exports_data:/app/exports
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
# Worker component - handles background jobs
worker:
image: ghcr.io/kjanat/chatlogger-api-worker${VERSION:-latest}
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
environment:
- DATABASE_URL=postgresql://dbuser:dbpassword@db:5432/chatlogger
- REDIS_ADDR=redis:6379
- EXPORT_DIR=/app/exports
- JWT_SECRET=${JWT_SECRET:-your-jwt-secret-replace-in-production}
restart: unless-stopped
volumes:
- cl_exports_data:/app/exports
healthcheck:
test: ["CMD", "ps", "aux", "|", "grep", "chatlogger-worker"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Redis for job queue
redis:
image: redis:alpine
ports:
- "6379:6379"
volumes:
- cl_redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
# Database service
db:
image: postgres:alpine
ports:
- "5432:5432"
environment:
- POSTGRES_USER=dbuser
- POSTGRES_PASSWORD=dbpassword
- POSTGRES_DB=chatlogger
volumes:
- cl_postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dbuser"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
cl_postgres_data:
cl_redis_data:
cl_exports_data: