forked from zanfranceschi/rinha-de-backend-2024-q1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
139 lines (133 loc) · 3.3 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
version: "3.9"
services:
nginx:
image: nginx:latest
hostname: nginx
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api1
- api2
ports:
- "9999:9999"
ulimits:
nproc: 1000000
nofile:
soft: 1000000
hard: 1000000
deploy:
resources:
limits:
cpus: "0.15"
memory: "80MB"
sysctls:
net.core.somaxconn: 4096
networks:
- backend-network
restart: "no"
api1: &api-template
container_name: api1
image: leluque/rinha2024q1:latest
environment:
BD_URL: r2dbc:postgresql://postgresql:5432/bd
BD_DIALECT: POSTGRES
BD_TYPE: postgres
BD_USUARIO: usuario
BD_SENHA: abc12345
BD_INITIAL_CONS: 19
BD_MAX_CONS: 20
REDIS_THREAD_POOL_SIZE: 370
REDIS_URL: redis://redis
depends_on:
- postgresql
ulimits:
nproc: 1000000
nofile:
soft: 1000000
hard: 1000000
networks:
- backend-network
deploy:
resources:
limits:
cpus: "0.4"
memory: "130MB"
restart: "no"
api2:
<<: *api-template
container_name: api2
postgresql:
container_name: postgresql
image: postgres:13.0-alpine
environment:
POSTGRES_USER: usuario
POSTGRES_PASSWORD: abc12345
POSTGRES_DB: bd
# ports:
# - "5432:5432"
command: >
postgres -c checkpoint_completion_target=0.9
-c checkpoint_timeout=1d
-c check_function_bodies=false
-c client_encoding=UTF8
-c client_min_messages=warning
-c default_statistics_target=100
-c default_table_access_method=heap
-c default_tablespace=''
-c effective_cache_size=75MB
-c effective_io_concurrency=200
-c fsync=off
-c full_page_writes=off
-c huge_pages=off
-c idle_in_transaction_session_timeout=0
-c lock_timeout=0
-c maintenance_work_mem=6400kB
-c max_connections=50
-c max_wal_size=4GB
-c min_wal_size=1GB
-c pg_stat_statements.max=10000
-c random_page_cost=1.1
-c row_security=off
-c shared_buffers=38MB
-c shared_preload_libraries="pg_stat_statements"
-c standard_conforming_strings=on
-c statement_timeout=0
-c synchronous_commit=off
-c wal_buffers=768kB
-c work_mem=1024kB
-c xmloption=content
volumes:
- ./docker/postgresql/dump.sql:/docker-entrypoint-initdb.d/dump.sql
networks:
- backend-network
deploy:
resources:
limits:
cpus: "0.50"
memory: "160MB"
ulimits:
nproc: 1000000
nofile:
soft: 1000000
hard: 1000000
restart: "no"
redis:
container_name: redis
image: redis:alpine
networks:
- backend-network
# ports:
# - "6379:6379"
deploy:
resources:
limits:
cpus: "0.10"
memory: "50MB"
ulimits:
nproc: 1000000
nofile:
soft: 1000000
hard: 1000000
restart: "no"
networks:
backend-network: