forked from zanfranceschi/rinha-de-backend-2024-q1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
88 lines (83 loc) · 1.89 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
version: '3.8'
services:
postgres:
hostname: postgres.rinha2024.local
image: postgres:16-alpine
platform: linux/amd64
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: rinha2024
ports:
- "5432:5432"
networks:
- rinha2024
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 10
deploy:
resources:
limits:
cpus: "0.50" # Ajustado conforme disponibilidade
memory: "150MB"
instance_1:
hostname: instance_1.rinha2024.local
image: elioenaiferrari/rinha2024:rust
platform: linux/amd64
ports:
- "4000:4000"
depends_on:
postgres:
condition: service_healthy
environment:
DATABASE_URL: postgres://postgres:[email protected]:5432/rinha2024
networks:
- rinha2024
deploy:
resources:
limits:
cpus: "0.40"
memory: "150MB"
instance_2:
hostname: instance_2.rinha2024.local
image: elioenaiferrari/rinha2024:rust
platform: linux/amd64
ports:
- "4001:4000"
depends_on:
postgres:
condition: service_healthy
instance_1:
condition: service_started
environment:
DATABASE_URL: postgres://postgres:[email protected]:5432/rinha2024
networks:
- rinha2024
deploy:
resources:
limits:
cpus: "0.40"
memory: "150MB"
nginx:
hostname: nginx.rinha2024.local
image: nginx:1.25-alpine
platform: linux/amd64
ports:
- "9999:9999"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- instance_1
- instance_2
networks:
- rinha2024
deploy:
resources:
limits:
cpus: "0.20"
memory: "100MB"
networks:
rinha2024:
driver: bridge