-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
55 lines (54 loc) · 1.15 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.9'
services:
proxy:
image: nginx
container_name: proxy
ports:
- '9999:9999'
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api01
- api02
deploy:
resources:
limits:
cpus: "0.1"
memory: "50MB"
api01: &api
container_name: api01
image: julianojj/rinha-backend-2024:latest
hostname: api01
environment:
- DB_URI=postgres://juliano:12345678@db:5432/rinha?sslmode=disable
- MAX_CONNECTIONS=30
depends_on:
- db
deploy:
resources:
limits:
cpus: "0.2"
memory: "75MB"
api02:
<<: *api
container_name: api02
image: julianojj/rinha-backend-2024:latest
hostname: api02
db:
image: postgres
container_name: db
environment:
- POSTGRES_USER=juliano
- POSTGRES_PASSWORD=12345678
- POSTGRES_DB=rinha
restart: always
volumes:
- ./script.sql:/docker-entrypoint-initdb.d/script.sql
- postgres_volume:/var/lib/postgresql/data
deploy:
resources:
limits:
cpus: "1"
memory: "300MB"
volumes:
postgres_volume: