-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
94 lines (90 loc) · 1.97 KB
/
docker-compose.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
version: '3.8'
services:
api1:
image: redvelvetdev/cgb-rinha-nodejs-q1-2024:1.2
network_mode: host
hostname: api1
restart: "on-failure"
depends_on:
db:
condition: service_healthy
expose:
- '9090'
environment:
API_PORT: 9090
POSTGRES_HOST: localhost
POSTGRES_DB: db_cake
POSTGRES_USER: cake
POSTGRES_PASSWORD: cake123
POSTGRES_PORT: 5432
deploy:
resources:
limits:
cpus: '0.175'
memory: '125MB'
api2:
image: redvelvetdev/cgb-rinha-nodejs-q1-2024:1.2
network_mode: host
hostname: api2
restart: "on-failure"
depends_on:
db:
condition: service_healthy
expose:
- '9091'
environment:
API_PORT: 9091
POSTGRES_HOST: localhost
POSTGRES_USER: cake
POSTGRES_PASSWORD: cake123
POSTGRES_DB: db_cake
POSTGRES_PORT: 5432
deploy:
resources:
limits:
cpus: '0.175'
memory: '125MB'
nginx:
image: nginx:latest
network_mode: host
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api1
- api2
ports:
- '9999:9999'
deploy:
resources:
limits:
cpus: '0.6'
memory: '30MB'
db:
image: postgres:latest
ports:
- '5432:5432'
network_mode: host
hostname: db
restart: "on-failure"
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"
]
interval: 3s
timeout: 5s
retries: 10
environment:
POSTGRES_USER: cake
POSTGRES_PASSWORD: cake123
POSTGRES_DB: db_cake
volumes:
- ./init-database.sql:/docker-entrypoint-initdb.d/init-database.sql
- ./postgresql.conf:/etc/postgresql/postgresql.conf
command: postgres -c config_file=/etc/postgresql/postgresql.conf
deploy:
resources:
limits:
cpus: '0.55'
memory: '270MB'