-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
64 lines (60 loc) · 1.54 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
version: '3.9'
services:
webapi1: &webapi1
image: jonathanperis/rinha2-back-end-bora-dale-xgh:latest
hostname: webapi1
container_name: webapi-1
depends_on:
- db
restart: always
environment: &env
ASPNETCORE_URLS: http://*:8080
ConnectionStrings__DefaultConnection: Host=localhost;Username=postgres;Password=postgres;Database=rinha;Minimum Pool Size=10;Maximum Pool Size=10;Multiplexing=true;
network_mode: host
deploy:
resources:
limits:
cpus: "0.4"
memory: "100MB"
webapi2:
<<: *webapi1
hostname: webapi2
container_name: webapi-2
environment:
<<: *env
ASPNETCORE_URLS: http://*:8081
db:
image: postgres
hostname: db
container_name: db-rinha
restart: always
volumes:
- ./conf/rinha.dump.sql:/docker-entrypoint-initdb.d/rinha.dump.sql:ro
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: rinha
network_mode: host
deploy:
resources:
limits:
cpus: "0.5"
memory: "330MB"
command: postgres -c checkpoint_timeout=600 -c max_wal_size=4096 -c synchronous_commit=0 -c fsync=0 -c full_page_writes=0
nginx:
image: nginx
hostname: nginx
container_name: nginx-rinha
volumes:
- ./conf/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- webapi1
- webapi2
expose:
- 9999
network_mode: host
deploy:
resources:
limits:
cpus: "0.2"
memory: "20MB"