-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yaml
105 lines (97 loc) · 2.18 KB
/
docker-compose.yaml
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
version: '3.9'
services:
api01: &api
network_mode: host
image: robertoseba940/rinha_backend:latest
hostname: api01
environment:
- DB_HOSTNAME=127.0.0.1
- DB_NAME=rinha
- DB_PASSWORD=123
- DB_USER=admin
- DB_POOL_SIZE=5
- DB_PORT=5432
- PORT=3000
ports:
- '3000:3000'
# - '9229:9229'
depends_on:
- db
deploy:
resources:
limits:
cpus: '0.4'
memory: '105MB'
healthcheck:
test: ['CMD', 'curl', '-f', 'http://127.0.0.1:3000/clientes/1/extrato']
interval: 2s
retries: 10
start_period: 10s
api02:
<<: *api
network_mode: host
hostname: api02
environment:
- DB_HOSTNAME=127.0.0.1
- DB_NAME=rinha
- DB_PASSWORD=123
- DB_USER=admin
- DB_POOL_SIZE=5
- DB_PORT=5432
- PORT=3001
healthcheck:
test: ['CMD', 'curl', '-f', 'http://127.0.0.1:3001/clientes/1/extrato']
interval: 2s
retries: 10
start_period: 10s
ports:
- '3001:3001'
nginx:
network_mode: host
image: nginx:latest
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- '9999:9999'
deploy:
resources:
limits:
cpus: '0.1'
memory: '20MB'
db:
network_mode: host
image: postgres:latest
hostname: db
environment:
- POSTGRES_PASSWORD=123
- POSTGRES_USER=admin
- POSTGRES_DB=rinha
ports:
- '5432:5432'
command: |
postgres
-c max_connections=640
-c listen_addresses='*'
-c log_min_messages='panic'
-c log_min_error_statement='panic'
-c checkpoint_timeout=3600
-c synchronous_commit=off
-c fsync=off
-c wal_level=minimal
-c max_wal_senders=0
-c full_page_writes=off
-c shared_buffers=200MB
-c maintenance_work_mem=200MB
-c work_mem=64MB
-c huge_pages=off
deploy:
resources:
limits:
cpus: '0.6'
memory: '320MB'
healthcheck:
test: ['CMD', 'pg_isready', '--username', 'admin', '-d', 'rinha']
interval: 15s
timeout: 5s
retries: 10
start_period: 15s