-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yaml
69 lines (64 loc) · 1.36 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
60
61
62
63
64
65
66
67
68
69
version: '3.7'
services:
api01: &api
image: geovannigava/rinhav2:v16
hostname: api01
restart: always
ports:
- "8081:8080"
environment:
POSTGRES_HOST: db
depends_on:
- db
deploy:
resources:
limits:
cpus: "0.2"
memory: "130MB"
api02:
<<: *api
hostname: api02
ports:
- "8082:8080"
nginx:
image: nginx:stable-perl
restart: always
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api01
- api02
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.15"
memory: "20MB"
db:
image: postgres:latest
hostname: db
environment:
- POSTGRES_PASSWORD=rinhav2
- POSTGRES_USER=rinhav2
- POSTGRES_DB=rinhav2
ports:
- "5432:5432"
volumes:
- ./script.sql:/docker-entrypoint-initdb.d/script.sql
command: 'postgres -c max_connections=1000 -c shared_buffers=128MB -c synchronous_commit=off -c fsync=off -c full_page_writes=off'
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 5s
timeout: 5s
retries: 20
start_period: 10s
deploy:
resources:
limits:
cpus: "0.95"
memory: "270MB"
networks:
default:
driver: bridge
name: rinhav2