-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
112 lines (108 loc) · 2.47 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
services:
api01:
image: ramondelemos/rinha_backend:latest
hostname: api01
container_name: api01
environment:
- DATABASE_USER=admin
- DATABASE_PASSWORD=123
- DATABASE_NAME=rinha
- DATABASE_HOST=postgres
- DATABASE_PORT=5432
- DATABASE_POOL_SIZE=10
- READ_DATABASE_POOL_SIZE=10
- EXECUTE_MIGRATIONS=true
- BACK_PRESSURE_ENABLED=true
- BACK_PRESSURE_TIMEOUT=2400
- BACK_PRESSURE_MAX_CONCURRENCY=100
ports:
- "4001:4001"
networks:
- default
depends_on:
postgres:
condition: service_healthy
restart: on-failure
deploy:
resources:
limits:
cpus: "0.55"
memory: "150MB"
api02:
image: ramondelemos/rinha_backend:latest
hostname: api02
container_name: api02
environment:
- DATABASE_USER=admin
- DATABASE_PASSWORD=123
- DATABASE_NAME=rinha
- DATABASE_HOST=postgres
- DATABASE_PORT=5432
- DATABASE_POOL_SIZE=10
- READ_DATABASE_POOL_SIZE=10
- EXECUTE_MIGRATIONS=false
- BACK_PRESSURE_ENABLED=true
- BACK_PRESSURE_TIMEOUT=2400
- BACK_PRESSURE_MAX_CONCURRENCY=100
ports:
- "4002:4001"
networks:
- default
depends_on:
postgres:
condition: service_healthy
api01:
condition: service_started
restart: on-failure
deploy:
resources:
limits:
cpus: "0.55"
memory: "150MB"
nginx:
image: nginx:latest
hostname: nginx
container_name: nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api01
- api02
ports:
- "9999:9999"
networks:
- default
restart: on-failure
deploy:
resources:
limits:
cpus: "0.15"
memory: "10MB"
postgres:
image: postgres:16.1-alpine
hostname: postgres
container_name: postgres
command: postgres -c checkpoint_timeout=600 -c max_wal_size=4096 -c synchronous_commit=0 -c full_page_writes=0
environment:
- POSTGRES_PASSWORD=123
- POSTGRES_USER=admin
- POSTGRES_DB=rinha
ports:
- "5432:5432"
networks:
- default
restart: on-failure
healthcheck:
interval: 5s
retries: 5
test: pg_isready -U admin -d rinha
timeout: 3s
deploy:
resources:
limits:
cpus: "0.25"
memory: "240MB"
networks:
default:
driver: bridge
name: rinha-nginx-2024q1