-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
79 lines (73 loc) · 2.05 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
version: "3.5"
# limits
# deploy.resources.limits.cpu 1.5
# deploy.resources.limits.memory 550MB
services:
api01: &api
container_name: rinha-api-01
image: fabionaspolini/rinha-backend-2024-q1-aot-dapper:async
network_mode: host
environment: &env
ASPNETCORE_URLS: http://*:9997
ConnectionStrings__Rinha: Server=127.0.0.1;Port=5433;Database=rinha;User Id=rinha;Password=rinha;Maximum Pool Size=3500;Minimum Pool Size=15;Application Name=rinha;
# ports:
# - "5201:9999"
depends_on:
- db
deploy:
resources:
limits:
cpus: "0.3"
memory: "60MB"
api02:
<<: *api
container_name: rinha-api-02
environment:
<<: *env
ASPNETCORE_URLS: http://*:9998
# ports:
# - "5202:9999"
nginx:
container_name: rinha-nginx
image: nginx:1.25.4-alpine
network_mode: host
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api01
- api02
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.2"
memory: "50MB"
db:
container_name: rinha-db
image: postgres:16.2-alpine3.19
network_mode: host
environment:
POSTGRES_PASSWORD: rinha
POSTGRES_USER: rinha
POSTGRES_DB: rinha
ports:
- "5433:5433"
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
command: postgres -p 5433 -c max_connections=7000 -c checkpoint_timeout=600 -c max_wal_size=4096 -c shared_buffers=256MB
deploy:
resources:
limits:
cpus: "0.7"
memory: "380MB"
# O uso do modo `bridge` deve ser adequado à carga que será usada no teste.
# A edição anterior se beneficiou do modo host pois o volume de requisições
# era relativamente alto e a virtualização da rede se tornou um gargalo, mas
# este modo é mais complexo de ser configurado. Fique à vontade para usar o
# modo que quiser desde que não conflite com portas trivialmente usadas em um
# SO.
# networks:
# default:
# driver: bridge
# name: rinha-nginx-2024q1