-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
75 lines (72 loc) · 1.58 KB
/
docker-compose.yaml
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
version: '3.5'
services:
api1: &app
image: marcosisocram/rinha-2024-q1:latest
hostname: api1
network_mode: "host"
depends_on:
db:
condition: service_healthy
expose:
- "8180"
environment:
- PORT=8180
- DB_URL=jdbc:postgresql://localhost:5433/postgres
- DB_USER=user
- DB_PASSWORD=rinha-de-bK
- DB_POOLSIZE=20
deploy:
resources:
limits:
cpus: '0.325'
memory: "90MB"
api2: # API - Instância 02
<<: *app
expose:
- "8280"
environment:
- PORT=8280
- DB_URL=jdbc:postgresql://localhost:5433/postgres
- DB_USER=user
- DB_PASSWORD=rinha-de-bK
- DB_POOLSIZE=20
hostname: api2
db:
image: postgres:latest
hostname: db
network_mode: "host"
environment:
- POSTGRES_PASSWORD=rinha-de-bK
- POSTGRES_USER=user
- POSTGRES_DB=postgres
- PGPORT=5433
expose:
- "5433"
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- ./postgresql.conf:/docker-entrypoint-initdb.d/postgresql.conf
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 5s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: '0.55'
memory: '300MB'
nginx-rinha: # Load Balancer
image: nginx:latest
network_mode: "host"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api1
- api2
expose:
- "9999"
deploy:
resources:
limits:
cpus: '0.3'
memory: '70MB'