-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdocker-compose.yaml
106 lines (100 loc) · 2.08 KB
/
docker-compose.yaml
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
services:
app:
image: gsai-container
env_file:
- .env
environment:
- DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
- WEBSOCKET_MANAGER=redis
- WEBSOCKET_REDIS_URL=redis://:@redis:6379/0
- RATE_LIMIT_REDIS_URL=redis://redis:6379/0
- REDIS_URL=redis://redis:6379/0
- PORT=8081
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8081/health"]
interval: 30s
timeout: 20s
retries: 10
start_period: 15s
volumes:
- app-data:/app
deploy:
replicas: 8 # keep at 1 if db is fresh, then scale/redeploy after first success
resources:
reservations:
cpus: "0.100"
memory: "500M"
limits:
cpus: "1.000"
memory: "1500M"
depends_on:
- db
- redis
networks:
backend:
aliases:
- app
nginx:
image: nginx:alpine
ports:
- "8080:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- app
deploy:
resources:
limits:
cpus: "0.2"
memory: "256M"
reservations:
cpus: "0.1"
memory: "128M"
networks:
- backend
db:
image: pgvector/pgvector:pg15
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres # pragma: allowlist secret
POSTGRES_DB: postgres
volumes:
- db-data:/var/lib/postgresql/data
deploy:
replicas: 1
resources:
limits:
cpus: "0.5"
memory: "1G"
reservations:
cpus: "0.3"
memory: "512M"
networks:
backend:
aliases:
- db
redis:
image: redis:alpine
ports:
- "6379:6379"
# volumes:
# - redis-data:/data
deploy:
replicas: 1
resources:
limits:
cpus: "0.2"
memory: "256M"
reservations:
cpus: "0.1"
memory: "128M"
networks:
backend:
aliases:
- redis
networks:
backend: {}
volumes:
app-data:
db-data:
# redis-data: