-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
90 lines (86 loc) · 2.01 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
89
90
version: "3.9"
services:
api01: &api
image: devblack21/rinha-backend-crebito:latest
container_name: api01
hostname: api01
platform: linux/amd64
restart: on-failure
network_mode: host
environment:
- DB_HOST=localhost:5432
- PROFILE=local
- PORT=20000
- JVM_XMS=110m
- JVM_XMX=110m
- CONTAINER_MEMORY=110m
- NEW_SIZE=5m
- MAX_NEW_SIZE=5m
- MIN_HEAP_FREE_RATIO=30
- MAX_HEAP_FREE_RATIO=70
- MIN_POOL_CONNECTION=2
- MAX_POOL_CONNECTION=2
depends_on:
- postgres-db
deploy:
resources:
limits:
cpus: "0.6"
memory: "234MB"
api02:
<<: *api
hostname: api02
container_name: api02
environment:
- DB_HOST=localhost:5432
- PORT=20001
- PROFILE=local
- JVM_XMS=110m
- JVM_XMX=110m
- NEW_SIZE=5m
- MAX_NEW_SIZE=5m
- CONTAINER_MEMORY=110m
- MIN_HEAP_FREE_RATIO=30
- MAX_HEAP_FREE_RATIO=70
- MIN_POOL_CONNECTION=2
- MAX_POOL_CONNECTION=2
nginx:
image: nginx:1.15.0-alpine
restart: on-failure
container_name: loadbalancer
platform: linux/amd64
network_mode: host
depends_on:
- api01
- api02
volumes:
- ./conf/nginx.conf:/etc/nginx/nginx.conf:ro
deploy:
resources:
limits:
cpus: "0.1"
memory: "16MB"
postgres-db:
image: postgres:15.3-bullseye
container_name: postgres-db
platform: linux/amd64
restart: on-failure
network_mode: host
deploy:
resources:
limits:
cpus: '0.2'
memory: '66MB'
volumes:
- ./conf/postgres.conf:/etc/postgresql/postgresql.conf:z
- ./data/init-sql.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD", "pg_isready", "-d", "rinha"]
interval: 10s
timeout: 60s
retries: 5
start_period: 20s
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=rinha
- PGUSER=postgres