-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
84 lines (79 loc) · 1.61 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
version: "3.5"
services:
db:
image: postgres:16
hostname: db
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: fight_club
ports:
- "5432:5432"
expose:
- "5432"
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- ./postgres.conf:/docker-entrypoint-initdb.d/postgres.conf
command: ["postgres", "-c", "config_file=/docker-entrypoint-initdb.d/postgres.conf"]
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 5s
timeout: 5s
retries: 20
start_period: 10s
deploy:
resources:
limits:
cpus: "1"
memory: "250MB"
nginx:
image: nginx:latest
restart: always
hostname: api
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api_01
- api_02
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.16"
memory: "50MB"
api_01: &api
image: eugeniocunha/fight-club:latest
restart: always
hostname: api_01
environment:
HTTP_PORT: 8080
DB_HOST: db
DB_USER: root
DB_PASSWORD: root
DB_NAME: fight_club
DB_PORT: 5432
DB_POOL: 30
expose:
- "8080"
depends_on:
- db
deploy:
resources:
limits:
cpus: "0.16"
memory: "100MB"
api_02:
<<: *api
hostname: api_02
environment:
HTTP_PORT: 8080
DB_HOST: db
DB_USER: root
DB_PASSWORD: root
DB_NAME: fight_club
DB_PORT: 5432
DB_POOL: 50
networks:
default:
driver: bridge