-
Notifications
You must be signed in to change notification settings - Fork 928
/
docker-compose.yml
84 lines (79 loc) · 2.2 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
version: "3.5"
services:
api01: &api
image: renatolfc/ferrugem:0.1
command: /app/rinha -d "postgresql://%2Fvar%2Frun%2Fpostgresql/rinha?user=postgres&password=postgres" --min-pool 2 --max-pool 2
hostname: api01
user: "999:999"
environment:
- PORT=9997
ulimits:
nofile:
soft: 1000000
hard: 1000000
network_mode: host
depends_on:
postgres:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.15"
memory: "8MB"
restart: always
volumes:
- shared:/var/run/postgresql
api02:
<<: *api
hostname: api02
environment:
- PORT=9998
balanco:
image: renatolfc/ferrugem:0.1
restart: always
depends_on:
- api01
- api02
environment:
- PORT=9999
- SERVERS=127.0.0.1:9997,127.0.0.1:9998
command: ["/app/balanço"]
network_mode: host
deploy:
resources:
limits:
cpus: "0.42"
memory: "8MB"
postgres:
image: postgres:latest
hostname: postgres
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=rinha
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- shared:/var/run/postgresql
command: >
postgres -c checkpoint_timeout=1200 -c max_wal_size=64MB -c wal_writer_delay=600
-c wal_buffers=8MB -c log_min_messages='panic' -c log_min_messages='panic'
-c log_min_error_statement='panic' -c synchronous_commit=off
-c full_page_writes=0 -c max_connections=64 -c shared_buffers=256MB
-c work_mem=256MB -c effective_cache_size=200MB
-c autovacuum_vacuum_scale_factor=.5 -c log_statement=none
-c log_checkpoints=0 -c log_duration=off
-c temp_buffers=2MB -c commit_delay=1200
-c max_parallel_workers=0
healthcheck:
test: ["CMD", "pg_isready", "--username", "postgres"]
interval: 60s
retries: 10
start_period: 20s
start_interval: 1s
deploy:
resources:
limits:
cpus: "0.78"
memory: "128MB"
volumes:
shared: