forked from zanfranceschi/rinha-de-backend-2024-q1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
80 lines (77 loc) · 1.57 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
version: "3"
# 1.5 550MB
# 0.5 200
# 0.4 150
# 0.4 150
# 0.2 50
services:
database:
image: postgres:16-alpine
command: postgres -c 'max_connections=50'
ports:
- "5432:5432"
environment:
- POSTGRES_USER=quarkus
- POSTGRES_PASSWORD=quarkus
restart: no
volumes:
- ./script.sql:/docker-entrypoint-initdb.d/script.sql
networks:
- default
deploy:
resources:
limits:
cpus: "0.5"
memory: "200MB"
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
start_period: 5s
interval: 5s
timeout: 5s
retries: 20
api01: &api
image: yanpgabriel/quarkus-rinha-2024-q1:latest
environment:
- DB_USER=quarkus
- DB_PASS=quarkus
- DB_NAME=quarkus
- DB_HOST=database:5432
- QUARKUS_DATASOURCE_JDBC_MAX_SIZE=20
- QUARKUS_DATASOURCE_JDBC_MIN_SIZE=2
- QUARKUS_DATASOURCE_JDBC_INITIAL_SIZE=2
ports:
- "8081:8080"
networks:
- default
depends_on:
database:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.4"
memory: "150MB"
api02:
# Essa sintaxe reusa o que foi declarado em 'api01'.
<<: *api
ports:
- "8082:8080"
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api01
- api02
ports:
- "9999:9999"
networks:
- default
deploy:
resources:
limits:
cpus: "0.2"
memory: "50MB"
networks:
default:
driver: bridge