-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
58 lines (54 loc) · 1.37 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
name: "health-checker-prod"
services:
backend:
image: jerometissot/health-checker-backend:latest
command: sh -c "npm run migration:up && npm run build && npm run prod"
env_file: .env
restart: always
expose:
- 4000
depends_on:
database:
condition: service_healthy
healthcheck:
test: 'curl --fail --request POST --header ''content-type: application/json'' --url ''http://localhost:4000/'' --data ''{"query":"query { __typename }"}'' || exit 1'
interval: 5s
timeout: 5s
retries: 20
frontend:
container_name: frontend
image: jerometissot/health-checker-frontend:latest
command: npm run build
env_file: .env
volumes:
- web-client-build:/app/dist
restart: always
depends_on:
backend:
condition: service_healthy
database:
image: postgres:16
env_file: .env
restart: always
expose:
- 5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"]
interval: 5s
timeout: 5s
retries: 20
volumes:
- ./data/database:/var/lib/postgresql/data
gateway:
image: nginx
ports:
- 7000:80
volumes:
- ./nginx-prod.conf:/etc/nginx/nginx.conf
- web-client-build:/web-client-build
restart: always
depends_on:
- backend
- frontend
volumes:
web-client-build: