-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
87 lines (83 loc) · 1.84 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
volumes:
pg_db_data: {}
services:
api1:
image: brunojppb/rinha-backend-elixir:latest
# build: .
environment:
DATABASE_URL: "postgres://rinha:rinha@pg_db/rinha"
SECRET_KEY_BASE: "Uqvf3M+IXeljed/6G07bXATy/teOrUpUZUhkKx8UEdLG5/INoUcj4VGJCBDTXBNP"
PHX_HOST: "api1"
PORT: "80"
depends_on:
pg_db:
condition: service_healthy
healthcheck:
test: curl -f http://api1:80
ports:
- "3333:80"
expose:
- "80"
deploy:
resources:
limits:
cpus: "0.25"
memory: "0.5GB"
api2:
image: brunojppb/rinha-backend-elixir:latest
# build: .
environment:
DATABASE_URL: "postgres://rinha:rinha@pg_db/rinha"
SECRET_KEY_BASE: "Uqvf3M+IXeljed/6G07bXATy/teOrUpUZUhkKx8UEdLG5/INoUcj4VGJCBDTXBNP"
PHX_HOST: "api2"
PORT: "80"
depends_on:
pg_db:
condition: service_healthy
ports:
- "4444:80"
healthcheck:
test: curl -f http://api2:80
expose:
- "80"
deploy:
resources:
limits:
cpus: "0.25"
memory: "0.5GB"
pg_db:
image: postgres:15
healthcheck:
test: ["CMD-SHELL", "pg_isready -U rinha"]
interval: 2s
timeout: 1s
retries: 5
environment:
- POSTGRES_USER=rinha
- POSTGRES_PASSWORD=rinha
- POSTGRES_DB=rinha
ports:
- "5432:5432"
volumes:
- pg_db_data:/var/lib/postgresql/data
deploy:
resources:
limits:
cpus: "0.85"
memory: "1.5GB"
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
api1:
condition: service_healthy
api2:
condition: service_healthy
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.15"
memory: "0.5GB"