-
Notifications
You must be signed in to change notification settings - Fork 10
/
docker-compose.native.yml
204 lines (198 loc) · 6.09 KB
/
docker-compose.native.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
version: "3.9"
services:
api01:
network_mode: host
image: caravanacloud/rinhadebackend-native:latest
hostname: api01
container_name: api01
environment:
- QUARKUS_HTTP_PORT=9001
- QUARKUS_BANNER_ENABLED=false
- QUARKUS_HTTP_IDLE_TIMEOUT=45
- QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://127.0.0.1:5400/rinha
- QUARKUS_DATASOURCE_JDBC_INITIAL_SIZE=15
- QUARKUS_DATASOURCE_JDBC_MIN_SIZE=15
- QUARKUS_DATASOURCE_JDBC_MAX_SIZE=15
- QUARKUS_DATASOURCE_JDBC_ACQUISITION_TIMEOUT=60
- QUARKUS_TRANSACTION_MANAGER_DEFAULT_TRANSACTION_TIMEOUT=60
- QUARKUS_DATASOURCE_JDBC_BACKGROUND_VALIDATION_INTERVAL=0
- QUARKUS_DATASOURCE_USERNAME=rinha
- QUARKUS_DATASOURCE_PASSWORD=123
- QUARKUS_LOG_LEVEL=ERROR
- QUARKUS_LOG_CATEGORY__caravanacloud__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__io.quarkus__LEVEL=DEBUG
- QUARKUS_LOG_CATEGORY__org.postgresql__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__io.netty__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__io.vertx__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__org.jboss__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__org.flyway__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__io.smallreye__LEVEL=INFO
ports:
- "9001:9990"
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://api01:9990/clientes/1/extrato"]
interval: 3s
retries: 15
ulimits:
nofile:
soft: 1000000
hard: 1000000
deploy:
resources:
limits:
cpus: "0.20"
memory: "70MB"
api02:
network_mode: host
image: caravanacloud/rinhadebackend-native:latest
hostname: api02
container_name: api02
environment:
- QUARKUS_HTTP_PORT=9002
- QUARKUS_BANNER_ENABLED=false
- QUARKUS_HTTP_IDLE_TIMEOUT=45
- QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://127.0.0.1:5400/rinha
- QUARKUS_DATASOURCE_JDBC_INITIAL_SIZE=15
- QUARKUS_DATASOURCE_JDBC_MIN_SIZE=15
- QUARKUS_DATASOURCE_JDBC_MAX_SIZE=15
- QUARKUS_DATASOURCE_JDBC_ACQUISITION_TIMEOUT=60
- QUARKUS_TRANSACTION_MANAGER_DEFAULT_TRANSACTION_TIMEOUT=60
- QUARKUS_DATASOURCE_JDBC_BACKGROUND_VALIDATION_INTERVAL=0
- QUARKUS_DATASOURCE_USERNAME=rinha
- QUARKUS_DATASOURCE_PASSWORD=123
- QUARKUS_LOG__LEVEL=ERROR
- QUARKUS_LOG_CATEGORY__caravanacloud__LEVEL=INFO
# - QUARKUS_LOG_CATEGORY__io.quarkus__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__org.postgresql__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__io.netty__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__io.vertx__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__org.jboss__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__org.flyway__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__io.smallreye__LEVEL=INFO
ports:
- "9002:9990"
depends_on:
db:
condition: service_healthy
api01:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://api02:9990/clientes/1/extrato"]
interval: 3s
retries: 15
ulimits:
nofile:
soft: 1000000
hard: 1000000
deploy:
resources:
limits:
cpus: "0.20"
memory: "70MB"
api03:
network_mode: host
image: caravanacloud/rinhadebackend-native:latest
hostname: api03
container_name: api03
environment:
- QUARKUS_HTTP_PORT=9003
- QUARKUS_BANNER_ENABLED=false
- QUARKUS_HTTP_IDLE_TIMEOUT=45
- QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://127.0.0.1:5400/rinha
- QUARKUS_DATASOURCE_JDBC_INITIAL_SIZE=15
- QUARKUS_DATASOURCE_JDBC_MIN_SIZE=15
- QUARKUS_DATASOURCE_JDBC_MAX_SIZE=15
- QUARKUS_DATASOURCE_JDBC_ACQUISITION_TIMEOUT=60
- QUARKUS_TRANSACTION_MANAGER_DEFAULT_TRANSACTION_TIMEOUT=60
- QUARKUS_DATASOURCE_JDBC_BACKGROUND_VALIDATION_INTERVAL=0
- QUARKUS_DATASOURCE_USERNAME=rinha
- QUARKUS_DATASOURCE_PASSWORD=123
- QUARKUS_LOG__LEVEL=ERROR
- QUARKUS_LOG_CATEGORY__caravanacloud__LEVEL=INFO
# - QUARKUS_LOG_CATEGORY__io.quarkus__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__org.postgresql__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__io.netty__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__io.vertx__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__org.jboss__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__org.flyway__LEVEL=INFO
- QUARKUS_LOG_CATEGORY__io.smallreye__LEVEL=INFO
ports:
- "9003:9990"
depends_on:
db:
condition: service_healthy
api01:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://api03:9990/clientes/1/extrato"]
interval: 3s
retries: 15
ulimits:
nofile:
soft: 1000000
hard: 1000000
deploy:
resources:
limits:
cpus: "0.20"
memory: "70MB"
nginx:
hostname: lb
container_name: lb
network_mode: host
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
api01:
condition: service_healthy
api02:
condition: service_healthy
api03:
condition: service_healthy
ports:
- "9999:9999"
ulimits:
nofile:
soft: 1000000
hard: 1000000
healthcheck:
test: ["CMD", "curl", "-f", "http://lb:9999/clientes/1/extrato"]
interval: 3s
retries: 15
deploy:
resources:
limits:
cpus: "0.30"
memory: "40MB"
db:
network_mode: host
image: postgres:latest
hostname: db
container_name: db
environment:
- POSTGRES_PASSWORD=123
- POSTGRES_USER=rinha
- POSTGRES_DB=rinha
ports:
- "5400:5400"
expose:
- "5400"
volumes:
- ./init.postgresql.sql:/docker-entrypoint-initdb.d/init.sql
- ./postgresql.conf:/etc/postgresql/postgresql.conf
command: 'postgres -c config_file=/etc/postgresql/postgresql.conf'
deploy:
resources:
limits:
cpus: "0.60"
memory: "300MB"
healthcheck:
test: ["CMD", "pg_isready", "--username", "rinha", "--port", "5400"]
interval: 5s
timeout: 1s
retries: 15
start_period: 5s