-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
63 lines (57 loc) · 1.48 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
version: '3.5'
services:
dotnet-web-01: &api
image: andregbiba/rinha-dotnet:latest
hostname: service-01
depends_on:
- postgres
environment:
ASPNETCORE_ENVIRONMENT: Production
HTTP_PORT: 8010
deploy:
resources:
limits:
cpus: "0.4"
memory: "110MB"
network_mode: host
dotnet-web-02:
<<: *api
hostname: service-02
environment:
ASPNETCORE_ENVIRONMENT: Production
HTTP_PORT: 8020
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- dotnet-web-01
- dotnet-web-02
network_mode: host
deploy:
resources:
limits:
cpus: "0.2"
memory: "20MB"
postgres:
image: postgres:latest
hostname: db
environment:
POSTGRES_USER: user_rinha
POSTGRES_PASSWORD: passwd_rinha
POSTGRES_DB: db_rinha
volumes:
- ./script.sql:/docker-entrypoint-initdb.d/script.sql
command: 'postgres -c max_connections=100 -c log_min_error_statement=panic -c log_min_duration_statement=-1 -c log_min_duration_sample=-1 -c log_min_messages=panic -c synchronous_commit=off -c fsync=off -c listen_addresses="*"'
network_mode: host
deploy:
resources:
limits:
cpus: "0.5"
memory: "310MB"
healthcheck:
test: ["CMD", "pg_isready", "--username", "rinha", "--port", "5432"]
interval: 3s
timeout: 2s
retries: 10
start_period: 3s