-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
82 lines (80 loc) · 2.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
version: "3.5"
services:
api01: &api
image: alanlopes/rinha-2024q1-dotnet
hostname: api01
depends_on:
- db
build:
context: .
dockerfile: Dockerfile
ports:
- '3001:3000'
environment:
TWIN_ADDRESS: api02
LABEL: "api01"
ASPNETCORE_ENVIRONMENT: Development
DB_HOSTNAME: db
Kestrel__Endpoints__Http__Url: http://0.0.0.0:3000
ConnectionStrings__DB: Host=db:5432;Port=5432;Database=rinha;Username=admin;Password=123;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;
MAX_CONCURRENT_CONNECTIONS: 1000
UDP_SOCKET_RECEIVE_TIMEOUT: 2
UDP_SOCKET_SEND_TIMEOUT: 2
deploy:
resources:
limits:
cpus: "0.2"
memory: "100MB"
api02:
<<: *api
hostname: api02
depends_on:
- db
ports:
- '3002:3000'
environment:
TWIN_ADDRESS: api01
LABEL: "api02"
ASPNETCORE_ENVIRONMENT: Development
DB_HOSTNAME: db
Kestrel__Endpoints__Http__Url: http://0.0.0.0:3000
ConnectionStrings__DB: Host=db:5432;Port=5432;Database=rinha;Username=admin;Password=123;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;
MAX_CONCURRENT_CONNECTIONS: 1000
SYNC_MEMORY: false
UDP_SOCKET_RECEIVE_TIMEOUT: 2
UDP_SOCKET_SEND_TIMEOUT: 2
db:
image: postgres:latest
hostname: db
environment:
- POSTGRES_PASSWORD=123
- POSTGRES_USER=admin
- POSTGRES_DB=rinha
ports:
- "5432:5432"
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
command: postgres -c max_connections=1000 -c max_wal_size=4096 -c checkpoint_timeout=600 -c synchronous_commit=off -c effective_cache_size=225MB -c shared_buffers=75MB -c fsync=off -c huge_pages=off -c work_mem=100MB -c maintenance_work_mem=256MB -c effective_io_concurrency=4
deploy:
resources:
limits:
cpus: "1"
memory: "300MB"
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api01
- api02
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.1"
memory: "50MB"
networks:
default:
driver: bridge
name: rinha-nginx-2024q1