-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
109 lines (102 loc) · 3.58 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
106
107
version: '3.9'
services:
api1:
image: ricardomauro/rinha-2024q1-dotnet-postgresql:latest
container_name: rpy-api1
network_mode: host
environment:
ConnectionStrings__Default: Host=localhost;Database=rinha;Username=rinha;Password=rinha;Pooling=true;Minimum Pool Size=50;Maximum Pool Size=2000;Multiplexing=true;Timeout=15;Command Timeout=15;Cancellation Timeout=-1;No Reset On Close=true;Max Auto Prepare=20;Auto Prepare Min Usages=1;;
ASPNETCORE_ENVIRONMENT: Production
ASPNETCORE_URLS: http://+:9997
#ASPNETCORE_URLS: https://+:9997;http://+:8097
#ASPNETCORE_Kestrel__Certificates__Default__Password: password
#ASPNETCORE_Kestrel__Certificates__Default__Path: ./aspnetapp.pfx
TRAIL: P_1
volumes:
- ./https/aspnetapp.pfx:/app/aspnetapp.pfx:ro
depends_on:
db:
condition: service_healthy
ulimits:
nofile:
soft: 1000000
hard: 1000000
deploy:
resources:
limits:
cpus: '0.3'
memory: '80MB'
api2:
image: ricardomauro/rinha-2024q1-dotnet-postgresql:latest
container_name: rpy-api2
network_mode: host
environment:
ConnectionStrings__Default: Host=localhost;Database=rinha;Username=rinha;Password=rinha;Pooling=true;Minimum Pool Size=50;Maximum Pool Size=2000;Multiplexing=true;Timeout=15;Command Timeout=15;Cancellation Timeout=-1;No Reset On Close=true;Max Auto Prepare=20;Auto Prepare Min Usages=1;;
ASPNETCORE_ENVIRONMENT: Production
ASPNETCORE_URLS: http://+:9998
#ASPNETCORE_URLS: https://+:9998;http://+:8098
#ASPNETCORE_Kestrel__Certificates__Default__Password: password
#ASPNETCORE_Kestrel__Certificates__Default__Path: ./aspnetapp.pfx
TRAIL: P_2
volumes:
- ./https/aspnetapp.pfx:/app/aspnetapp.pfx:ro
depends_on:
db:
condition: service_healthy
ulimits:
nofile:
soft: 1000000
hard: 1000000
deploy:
resources:
limits:
cpus: '0.3'
memory: '80MB'
yarp:
image: ricardomauro/rinha-2024q1-dotnet-yarp:latest
container_name: rpy-proxy
network_mode: host
environment:
ConnectionStrings__Default: Host=localhost;Database=rinha;Username=rinha;Password=rinha;Pooling=true;Minimum Pool Size=50;Maximum Pool Size=2000;Multiplexing=true;Timeout=15;Command Timeout=15;Cancellation Timeout=-1;No Reset On Close=true;Max Auto Prepare=20;Auto Prepare Min Usages=1;;
DOTNET_URLS: http://*:9999
ASPNETCORE_ENVIRONMENT: Production
volumes:
- ./yarp/secrets.json:/app/secrets.json:ro
depends_on:
- api1
- api2
deploy:
resources:
limits:
cpus: '0.4'
memory: '134MB'
db:
image: postgres:16.2
container_name: rpy-db
network_mode: host
command: 'postgres -c max_connections=300 -c shared_buffers=96MB -c checkpoint_timeout=600 -c synchronous_commit=off -c fsync=off -c full_page_writes=off -c work_mem=16MB'
hostname: db
environment:
- POSTGRES_PASSWORD=rinha
- POSTGRES_USER=rinha
- POSTGRES_DB=rinha
volumes:
- ./postgresql/ddl.sql:/docker-entrypoint-initdb.d/ddl-postgresql.sql:ro
- type: tmpfs
target: /var/lib/postgresql/data
deploy:
resources:
limits:
cpus: '0.5'
memory: '256MB'
healthcheck:
test: ["CMD", "pg_isready", "--username", "rinha"]
interval: 15s
timeout: 5s
retries: 10
start_period: 10s
# start_interval: 1s # only available in Docker engine 25+
ulimits:
nofile:
soft: 65535
hard: 65535