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
43services:
nginx:
build:
context: .
dockerfile: nginx/Dockerfile
ports:
- "8080:80"
depends_on:
- backend01
- backend02
- backend03
backend01:
build:
context: ./server
depends_on:
db:
condition: service_healthy
backend02:
build:
context: ./server
depends_on:
db:
condition: service_healthy
backend03:
build:
context: ./server
depends_on:
db:
condition: service_healthy
db:
image: postgres:14
environment:
POSTGRES_PASSWORD: "changeit"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5