-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
105 lines (99 loc) · 2.42 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
version: "3.5"
services:
api01: &api
image: vitorsalgado/rinha-2024q1-api
pull_policy: always
container_name: api01
hostname: api01
network_mode: host
environment:
- DB_CONN_STRING=user=rinha password=rinha dbname=rinha host=0.0.0.0 port=6432 sslmode=disable pool_min_conns=5 pool_max_conns=5
- ADDR=:8081
- GOGC=400
- GOMEMLIMIT=70MiB
depends_on:
db:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.2"
memory: "75MB"
api02:
<<: *api
container_name: api02
hostname: api02
network_mode: host
environment:
- DB_CONN_STRING=user=rinha password=rinha dbname=rinha host=0.0.0.0 port=6432 sslmode=disable pool_min_conns=5 pool_max_conns=5
- ADDR=:8082
- GOGC=400
- GOMEMLIMIT=70MiB
lb:
image: vitorsalgado/rinha-2024q1-lb
pull_policy: always
container_name: lb
hostname: lb
network_mode: host
environment:
- BACKEND_ENDPOINTS=0.0.0.0:8081,0.0.0.0:8082
- ADDR=0.0.0.0:9999
- GOGC=400
- GOMEMLIMIT=75MiB
expose:
- "9999"
depends_on:
- api01
- api02
deploy:
resources:
limits:
cpus: "0.3"
memory: "80MB"
db:
image: postgres:16.2
container_name: db
environment:
- POSTGRES_PASSWORD=rinha
- POSTGRES_USER=rinha
- POSTGRES_DB=rinha
network_mode: host
expose:
- "5432"
volumes:
- ./conf/script.sql:/docker-entrypoint-initdb.d/script.sql
- ./conf/postgresql.conf:/etc/postgresql/postgresql.conf
- data:/var/lib/postgresql/data
command: postgres -c config_file=/etc/postgresql/postgresql.conf
healthcheck:
test: ["CMD", "pg_isready", "--username", "rinha"]
interval: 5s
timeout: 5s
retries: 15
start_period: 10s
deploy:
resources:
limits:
cpus: "0.6"
memory: "300MB"
bouncer:
image: vitorsalgado/rinha-2024q1-bouncer
pull_policy: always
container_name: bouncer
environment:
PGB_DATABASES: rinha = host=0.0.0.0 port=5432 pool_mode=statement pool_size=20
PGB_ADMIN_USERS: rinha
PGB_ADMIN_PASSWORDS: rinha
network_mode: host
expose:
- "6432"
depends_on:
db:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.2"
memory: "20MB"
volumes:
data: