-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
69 lines (67 loc) · 1.56 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
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
expose:
- "8080"
depends_on:
postgres:
condition: service_healthy
environment:
SPRING_DATASOURCE_URL: "jdbc:postgresql://postgres:5432/postgres"
ulimits:
nproc: 1000000
nofile:
soft: 1000000
hard: 1000000
deploy:
resources:
limits:
cpus: "0.2"
memory: "128MB"
app2:
<<: *app
hostname: app2
postgres:
image: postgres:latest
command: postgres -c config_file=/etc/postgresql/postgresql.conf
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
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
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- app1
- app2
ports:
- "9999:9999"
ulimits:
nproc: 1000000
nofile:
soft: 1000000
hard: 1000000
deploy:
resources:
limits:
cpus: "0.04"
memory: "42MB"