-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
95 lines (89 loc) · 1.93 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
94
95
version: "3.9"
services:
api01: &api
image: ptrecenti/crebito:latest
entrypoint:
- "/crebito"
- "-Xms64m"
- "-Xmx64m"
- "-ea"
- "-server"
hostname: api01
environment:
- SCALE_FACTOR=30
- DB_HOSTNAME=db
- DB_PORT=5432
- DB_NAME=rinha
- DB_USER=rinha
- DB_PASS=rinha
- DB_POOL=10
depends_on:
db:
condition: service_healthy
networks:
- app-network
deploy:
resources:
limits:
cpus: "0.3"
memory: "96MB"
api02:
<<: *api
hostname: api02
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api01
- api02
ports:
- "9999:9999"
networks:
- app-network
deploy:
resources:
limits:
cpus: "0.15"
memory: "24MB"
db:
image: postgres:latest
hostname: db
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=rinha
- POSTGRES_USER=rinha
- POSTGRES_DB=rinha
volumes:
- ./sql/ddl.sql:/docker-entrypoint-initdb.d/ddl.sql
- ./sql/dml.sql:/docker-entrypoint-initdb.d/dml.sql
command: "postgres
-c max_connections=100
-c shared_buffers=96MB
-c effective_cache_size=288MB
-c maintenance_work_mem=24MB
-c checkpoint_completion_target=0.675
-c checkpoint_timeout=300
-c wal_buffers=2949kB
-c default_statistics_target=75
-c random_page_cost=0.825
-c effective_io_concurrency=150
-c work_mem=384kB
-c min_wal_size=750MB
-c max_wal_size=3GB"
deploy:
resources:
limits:
cpus: "0.75"
memory: "334MB"
networks:
- app-network
healthcheck:
test: [ "CMD", "pg_isready", "--username", "rinha" ]
interval: 5s
timeout: 5s
retries: 20
start_period: 10s
networks:
app-network: