/
docker-compose.yml
62 lines (58 loc) · 1.13 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
version: "3.5"
services:
api1: &api
container_name: api1
platform: linux/amd64
hostname: api1
image: matheusmcamargo/rinha-api:ledger
working_dir: /opt/rinha
command:
- -port=8080
build:
context: .
dockerfile: ./api/Dockerfile
deploy:
resources:
limits:
cpus: "0.35"
memory: "97MB"
api2:
<<: *api
container_name: api2
command:
- -port=8080
hostname: api2
lb:
image: nginx
hostname: lb
container_name: lb
ports:
- 9999:9999
volumes:
- ./nginx:/etc/nginx
deploy:
resources:
limits:
cpus: "0.2"
memory: "100MB"
db:
image: postgres:latest
hostname: db
container_name: db
environment:
- POSTGRES_PASSWORD=password
- POSTGRES_USER=admin
- POSTGRES_DB=rinha
command:
- postgres
- -c
- config_file=/docker-entrypoint-initdb.d/postgresql.conf
ports:
- 5432:5432
volumes:
- ./db:/docker-entrypoint-initdb.d
deploy:
resources:
limits:
cpus: "0.55"
memory: "256MB"