-
Notifications
You must be signed in to change notification settings - Fork 925
/
docker-compose.yml
79 lines (75 loc) · 1.78 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.8'
name: rinha-de-backend-lbaesso-dotnet
services:
app1: &app
container_name: app1
image: lbaisso/rinha-de-backend-2024-q1-dotnet:latest
network_mode: host
depends_on:
postgres:
condition: service_healthy
environment:
- DB_HOST=localhost
- DB_PORT=5432
- DB_USER=postgres
- DB_PASS=password
- DB_NAME=rinha
- DB_MIN_POOL_SIZE=4
- DB_MAX_POOL_SIZE=4
- Kestrel__Endpoints__Http__Url=http://*:9001
deploy:
resources:
limits:
cpus: "0.37"
memory: "110MB"
app2:
<<: *app
container_name: app2
environment:
- DB_HOST=localhost
- DB_PORT=5432
- DB_USER=postgres
- DB_PASS=password
- DB_NAME=rinha
- DB_MIN_POOL_SIZE=4
- DB_MAX_POOL_SIZE=4
- Kestrel__Endpoints__Http__Url=http://*:9002
gateway:
container_name: gateway
image: nginx:latest
volumes:
- ./nginx-proxy.conf:/etc/nginx/nginx.conf:ro
depends_on:
- app1
- app2
network_mode: host
expose:
- 9999
deploy:
resources:
limits:
cpus: "0.26"
memory: "40MB"
postgres:
container_name: postgres
hostname: postgres
image: postgres:latest
command: postgres -c 'max_connections=64' -c 'shared_buffers=280MB'
network_mode: host
volumes:
- ./script.sql:/docker-entrypoint-initdb.d/script.sql
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: rinha
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 5s
timeout: 10s
start_period: 5s
retries: 3
deploy:
resources:
limits:
cpus: "0.50"
memory: "290MB"