-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
68 lines (65 loc) · 1.5 KB
/
docker-compose.yml
File metadata and controls
68 lines (65 loc) · 1.5 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
services:
client:
build:
context: ./client
dockerfile: Dockerfile
container_name: mutabor_prod_client
ports:
- "3000:3000"
depends_on:
api:
condition: service_healthy
environment:
- VITE_API_URL=http://localhost:3001
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
api:
build:
context: ./api
dockerfile: Dockerfile
container_name: mutabor_prod_api
ports:
- "3001:3001"
depends_on:
db:
condition: service_healthy
env_file:
- ./api/.env
environment:
- PORT=3001
- NODE_ENV=production
- DATABASE_URL=postgresql://user:password@db:5432/mutabor?schema=public
- DB_HOST=db
- DB_PORT=5432
- DB_USER=user
- DB_PASSWORD=password
- DB_NAME=mutabor
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:3001/health"]
interval: 15s
timeout: 5s
retries: 5
start_period: 30s
db:
image: postgres:13
container_name: mutabor_prod_db
ports:
- "54321:5432"
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: mutabor
volumes:
- postgres_prod_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d mutabor"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
volumes:
postgres_prod_data: