forked from zanfranceschi/rinha-de-backend-2024-q1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
72 lines (70 loc) · 1.69 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
version: "3"
## run command: docker-compose --compatibility --file docker-compose-stress-test.yml up --force-recreate --buid
services:
app1: &app
image: docker.io/weirichvitor/java-rinha-2024-q1-graalvm:latest
hostname: app1
command: ["./backend", "--server.port=8083"]
expose:
- "8083"
network_mode: host
depends_on:
postgres:
condition: service_healthy
environment:
SPRING_DATASOURCE_URL: "jdbc:postgresql://localhost:5432/postgres"
ulimits:
nproc: 1000000
nofile:
soft: 1000000
hard: 1000000
deploy:
resources:
limits:
cpus: "0.2"
memory: "128MB"
app2:
<<: *app
hostname: app2
command: ["./backend", "--server.port=8084"]
expose:
- "8084"
postgres:
image: postgres:latest
command: postgres -c config_file=/etc/postgresql/postgresql.conf
network_mode: host
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- ./postgresql.conf:/etc/postgresql/postgresql.conf:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 5s
timeout: 5s
retries: 20
deploy:
resources:
limits:
cpus: "1.06"
memory: "252MB"
nginx: # Load Balancer
image: nginx:latest
network_mode: host
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- app1
- app2
ulimits:
nproc: 1000000
nofile:
soft: 1000000
hard: 1000000
deploy:
resources:
limits:
cpus: "0.04"
memory: "42MB"