-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
64 lines (60 loc) · 1.44 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
version: '3.8'
services:
nginx:
image: nginx
hostname: rinha-nginx
container_name: rinha-nginx
ports:
- "9999:9999"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
depends_on:
- api1
- api2
deploy:
resources:
limits:
cpus: "0.20"
memory: "137MB"
api1: &api
image: brunocamarggo/rinha2024q1
container_name: rinha2024q1-api-1
hostname: rinha2024q1-api-1
environment:
DB_HOST: db
depends_on:
db:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.30"
memory: "137MB"
api2:
<<: *api
container_name: rinha2024q1-api-2
hostname: rinha2024q1-api-2
db:
image: postgres:16
hostname: rinha-db
container_name: rinha-db
environment:
POSTGRES_DB: rinha
POSTGRES_USER: rinha
POSTGRES_PASSWORD: rinha123
volumes:
- ./script.sql:/docker-entrypoint-initdb.d/script.sql
- ./postgresql.conf:/etc/postgresql/postgresql.conf
command: postgres -c config_file=/etc/postgresql/postgresql.conf
ports:
- "5432:5432"
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "rinha", "-U", "rinha", "-h", "localhost" ]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: "0.70"
memory: "137MB"