-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
49 lines (47 loc) · 1.24 KB
/
Copy pathdocker-compose.yml
File metadata and controls
49 lines (47 loc) · 1.24 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
services:
postgres:
image: postgres:16-alpine
container_name: voicelife-postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-voicelife}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
POSTGRES_DB: ${POSTGRES_DB:-voicelife}
ports:
- "127.0.0.1:${POSTGRES_PORT:-5432}:5432"
volumes:
- voicelife_postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 2s
timeout: 3s
retries: 15
gateway:
build:
context: services/im-gateway
container_name: voicelife-im-gateway
env_file:
- .env
environment:
GATEWAY_HOST: 0.0.0.0
GATEWAY_PORT: 3000
DATABASE_HOST: postgres
ports:
- "127.0.0.1:${GATEWAY_PORT:-3000}:3000"
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://127.0.0.1:3000/healthz').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))",
]
interval: 10s
timeout: 3s
start_period: 10s
retries: 3
volumes:
voicelife_postgres_data: