-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdocker-compose.20240218.yml
164 lines (158 loc) · 4.56 KB
/
docker-compose.20240218.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
version: "3.9"
services:
api01:
networks:
- rinha-net
image: caravanacloud/rinhadebackend-native:latest
hostname: api01
container_name: api01
environment:
- DB_HOSTNAME=db
- QUARKUS_BANNER_ENABLED=false
- QUARKUS_HTTP_IDLE_TIMEOUT=45
- QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://db: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.25"
memory: "90MB"
api02:
networks:
- rinha-net
image: caravanacloud/rinhadebackend-native:latest
hostname: api02
container_name: api02
environment:
- DB_HOSTNAME=db
- QUARKUS_BANNER_ENABLED=false
- QUARKUS_HTTP_IDLE_TIMEOUT=45
- QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://db: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.25"
memory: "90MB"
nginx:
hostname: lb
container_name: lb
networks:
- rinha-net
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
api01:
condition: service_healthy
api02:
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:
networks:
- rinha-net
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.70"
memory: "330MB"
healthcheck:
test: ["CMD", "pg_isready", "--username", "rinha", "--port", "5400"]
interval: 5s
timeout: 1s
retries: 15
start_period: 5s
networks:
rinha-net:
driver: bridge
driver_opts:
com.docker.network.driver.mtu: 9000