forked from zanfranceschi/rinha-de-backend-2024-q1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
59 lines (56 loc) · 1.22 KB
/
docker-compose.yaml
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
version: '3.5'
services:
api1: &api
image: guihbc/rinha-de-backend-2024-q1
hostname: api1
network_mode: host
depends_on:
- database
environment:
- LISTEN_HTTP_PORT=:9997
- DB_URL=postgres://admin:123@localhost:5432/rinha
deploy:
resources:
limits:
cpus: "0.6"
memory: "100MB"
api2:
<<: *api
hostname: api2
environment:
- LISTEN_HTTP_PORT=:9998
- DB_URL=postgres://admin:123@localhost:5432/rinha
nginx:
image: nginx:1.25.4-alpine
hostname: api
network_mode: host
container_name: rinha-de-backend-2024-q1-nginx
volumes:
- ./scripts/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api1
- api2
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.17"
memory: "30MB"
database:
image: postgres:latest
hostname: db
network_mode: host
environment:
- POSTGRES_PASSWORD=123
- POSTGRES_USER=admin
- POSTGRES_DB=rinha
ports:
- "5432:5432"
volumes:
- ./scripts/postgres:/docker-entrypoint-initdb.d
deploy:
resources:
limits:
cpus: "0.13"
memory: "320MB"