-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
93 lines (87 loc) · 2.23 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
83
84
85
86
87
88
89
90
91
92
93
version: "3.5"
services:
rinhadb:
image: postgres:latest
hostname: RinhaDB
environment:
- POSTGRES_PASSWORD=Q1w2e3r4t5y6!
- POSTGRES_USER=postgres
- POSTGRES_DB=RinhaDeBackend
volumes:
- ./sobeabodega.sql:/docker-entrypoint-initdb.d/sobeabodega.sql
- postgresql_socket:/var/run/postgresql
command: postgres -c max_connections=200 -c synchronous_commit=off -c fsync=off -c full_page_writes=off -c effective_io_concurrency=200 -c wal_level=minimal -c max_wal_senders=0 -c shared_buffers=128MB -c effective_cache_size=256MB -c checkpoint_timeout=30min
deploy:
resources:
limits:
cpus: "0.65"
memory: "400MB"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -h localhost -d RinhaDeBackend"]
interval: 5s
timeout: 5s
retries: 5
network_mode: host
api01: &api
image: wstumpf/rinha-api:latest
hostname: api01
environment:
- INSTANCE_ID=01
volumes:
- postgresql_socket:/var/run/postgresql
- kestrel_socket_api01:/tmp
depends_on:
rinhadb:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.35"
memory: "50MB"
network_mode: host
api02:
<<: *api
hostname: api02
environment:
- INSTANCE_ID=02
volumes:
- postgresql_socket:/var/run/postgresql
- kestrel_socket_api02:/tmp
depends_on:
rinhadb:
condition: service_healthy
network_mode: host
chmod:
image: alpine
command: >
/bin/sh -c "
sleep 2 &&
chmod 777 /tmp01/api_01.sock &&
chmod 777 /tmp02/api_02.sock &&
sleep 2"
volumes:
- kestrel_socket_api01:/tmp01
- kestrel_socket_api02:/tmp02
depends_on:
- api01
- api02
network_mode: host
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- kestrel_socket_api01:/tmp01
- kestrel_socket_api02:/tmp02
depends_on:
chmod:
condition: service_completed_successfully
deploy:
resources:
limits:
cpus: "0.15"
memory: "50MB"
network_mode: host
volumes:
postgresql_socket:
kestrel_socket_api01:
kestrel_socket_api02: