-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
45 lines (43 loc) · 1018 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
45 lines (43 loc) · 1018 Bytes
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
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: leetcode_recoder
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d leetcode_recoder"]
interval: 5s
timeout: 5s
retries: 10
start_period: 5s
app:
build:
context: .
dockerfile: Dockerfile
environment:
DATABASE_URL: "postgresql://user:password@postgres:5432/leetcode_recoder"
ports:
- "3000:3000"
depends_on:
postgres:
condition: service_healthy
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:3000').then((response) => { if (!response.ok) process.exit(1) }).catch(() => process.exit(1))",
]
interval: 10s
timeout: 5s
retries: 10
start_period: 20s
init: true
volumes:
pgdata: