-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
55 lines (51 loc) · 1.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
version: "3.5"
services:
fastapi01: &app01
restart: always
image: chipytux/rinha24:latest
network_mode: host
entrypoint: 'uvicorn backend.main:app --host 0.0.0.0 --port 8000 --workers 1 --log-level error'
environment:
DATABASE_URL: "postgresql+asyncpg://root:1234@localhost:5432/rinha"
POOL_SIZE: 40
MAX_OVERFLOW: 20
depends_on:
- db
deploy:
resources:
limits:
cpus: "0.42"
memory: "110MB"
fastapi02:
<<: *app01
entrypoint: 'uvicorn backend.main:app --host 0.0.0.0 --port 8001 --workers 1 --log-level error'
nginx:
image: nginx:1.25-alpine
restart: always
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- fastapi01
- fastapi02
network_mode: host
deploy:
resources:
limits:
cpus: "0.16"
memory: "20MB"
db:
image: postgres:16-alpine
command: postgres -c config_file=/etc/postgresql.conf
volumes:
- ./script.sql:/docker-entrypoint-initdb.d/script.sql:ro
- ./postgresql.conf:/etc/postgresql.conf:ro
network_mode: host
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: 1234
POSTGRES_DB: rinha
deploy:
resources:
limits:
cpus: "0.5"
memory: "310MB"