forked from zanfranceschi/rinha-de-backend-2024-q1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
68 lines (64 loc) · 1.6 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
services:
api1:
container_name: api1
image: gasparbarancelli/rinha-backend-2024-procedure:latest
network_mode: host
environment:
- QUARKUS_HTTP_PORT=8081
depends_on:
db:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.35"
memory: "105MB"
api2:
container_name: api2
image: gasparbarancelli/rinha-backend-2024-procedure:latest
network_mode: host
environment:
- QUARKUS_HTTP_PORT=8082
depends_on:
db:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.35"
memory: "105MB"
nginx:
image: nginx:latest
network_mode: host
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api1
- api2
deploy:
resources:
limits:
cpus: "0.2"
memory: "50MB"
db:
container_name: db
image: postgres:latest
network_mode: host
environment:
- POSTGRES_PASSWORD=backend
- POSTGRES_USER=rinha
- POSTGRES_DB=rinha-backend
command: 'postgres -c max_connections=1000 -c work_mem=8MB -c hot_standby=off -c shared_buffers=135MB -c checkpoint_timeout=1d -c wal_level=minimal -c synchronous_commit=off -c fsync=off -c full_page_writes=off -c max_wal_senders=0'
volumes:
- ./import.sql:/docker-entrypoint-initdb.d/script.sql
deploy:
resources:
limits:
cpus: "0.6"
memory: "290MB"
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 5s
timeout: 5s
retries: 20
start_period: 10s