-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
81 lines (75 loc) · 1.62 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
version: '3.5'
services:
api1: &api
image: thyagopiske/rinha-api
# ports:
# - 8080:8080
environment:
- HOST=db
# - ASPNETCORE_HTTP_PORTS=8080
# - UnixSocketPath=/tmp/api1.sock
networks:
- mynet
volumes:
- /var/run/postgresql_tp:/var/run/postgresql
# - /tmp/api1.sock:/tmp/api1.sock
# network_mode: host
deploy:
resources:
limits:
cpus: '0.3'
memory: 150M
api2:
<<: *api
# environment:
# - ASPNETCORE_HTTP_PORTS=8081
# - UnixSocketPath=/tmp/api2.sock
ports:
- 8081:8080
# volumes:
# - /tmp/api2.sock:/tmp/api2.sock
db:
image: postgres:latest
command: postgres -c max_connections=50 -c synchronous_commit='off'
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin
POSTGRES_DB: mydb
ports:
- 5432:5432
volumes:
- pgdata_tp:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- /var/run/postgresql_tp:/var/run/postgresql/
networks:
- mynet
# network_mode: host
deploy:
resources:
limits:
cpus: '0.75'
memory: 240M
nginx:
image: nginx:latest
ports:
- 9999:9999
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
# - /tmp/api1.sock:/tmp/api1.sock
# - /tmp/api2.sock:/tmp/api2.sock
depends_on:
- api1
- api2
networks:
- mynet
# network_mode: host
deploy:
resources:
limits:
cpus: '0.15'
memory: 10M
networks:
mynet:
driver: bridge
volumes:
pgdata_tp: