-
Notifications
You must be signed in to change notification settings - Fork 928
/
docker-compose.yml
69 lines (68 loc) · 1.48 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
version: "3.9"
services:
db:
image: postgres
restart: always
ports:
- "5432:5432"
volumes:
- ./conf/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
- ./conf/postgresql.conf:/etc/postgresql/postgresql.conf
command: postgres -c config_file=/etc/postgresql/postgresql.conf
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: rinha
deploy:
resources:
limits:
cpus: "0.40"
memory: "250MB"
healthcheck:
test:
[
"CMD",
"pg_isready",
"--dbname=rinha",
"--username=postgres"
]
interval: 2s
timeout: 1m
retries: 5
start_period: 10s
api1: &api1
image: rafaelpadovezi/rinha-2-django:1.0
hostname: api1
depends_on:
db:
condition: service_healthy
environment:
- DB_HOST=db
- USE_STATIC_FILE_HANDLER_FROM_WSGI=TRUE
- DATABASE_URL=host=db dbname=rinha user=postgres password=postgres
- GUNICORN_WORKERS=2
- DB_POOL_MAX_SIZE=45
- DEBUG=False
deploy:
resources:
limits:
cpus: "0.47"
memory: "140MB"
api2:
<<: *api1
hostname: api2
ports:
- "8081:8080"
nginx:
image: nginx:alpine
ports:
- "9999:9999"
volumes:
- ./conf/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api1
- api2
deploy:
resources:
limits:
cpus: "0.16"
memory: "20MB"