-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
73 lines (68 loc) · 1.68 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
version: "3.9"
services:
api01: &api
image: matheuslao/api-rinha-backend-2024-01:1.0.0
hostname: api01
command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]
ulimits:
nofile:
soft: 10000
hard: 10000
environment:
- DB_USER=admin
- DB_PASSWORD=123
- DB_NAME=rinha
- DB_HOST=db
depends_on:
- db
deploy:
resources:
limits:
cpus: "0.5"
memory: "130MB"
api02:
<<: *api
hostname: api02
nginx:
image: nginx:1.25
volumes:
- ./conf/nginx.conf:/etc/nginx/nginx.conf:ro
ulimits:
nofile:
soft: 1000000
hard: 1000000
depends_on:
- api01
- api02
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.1"
memory: "50MB"
db:
image: postgres:16.2
hostname: db
command: 'postgres -c max_connections=100 -c work_mem=4MB -c maintenance_work_mem=16MB -c effective_cache_size=128MB -c checkpoint_completion_target=0.5 -c shared_buffers=64MB -c synchronous_commit=off -c fsync=off -c full_page_writes=off -c checkpoint_timeout=600 -c max_wal_size=4096'
environment:
- POSTGRES_PASSWORD=123
- POSTGRES_USER=admin
- POSTGRES_DB=rinha
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
volumes:
- ./conf/init.sql:/docker-entrypoint-initdb.d/init.sql
deploy:
resources:
limits:
cpus: "0.4"
memory: "240MB"
networks:
default:
driver: bridge
name: rinha-nginx-2024q1