-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
71 lines (67 loc) · 1.43 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
version: '3.5'
services:
api1: &api
image: rafaelktakahashi/ferrugem:latest
restart: always
hostname: api1
environment:
DATABASE_URL: postgres://postgres:999@db:5432/postgres?schema=public&sslmode=disable
MAX_DB_CONNECTIONS: 9
KEEPALIVE_DURATION: 5
DB_POOL_TIMEOUT: 20000
PORT: 3000
ulimits:
nofile:
soft: 1000000
hard: 1000000
depends_on:
- db
expose:
- "3000"
ports:
# For diagnosing
- "3000:3000"
deploy:
resources:
limits:
cpus: '0.11'
memory: '20MB'
api2:
<<: *api
image: rafaelktakahashi/ferrugem:latest
hostname: api2
ports:
- "3001:3000"
nginx:
image: nginx:1.25.4
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api1
- api2
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: '0.18'
memory: '30MB'
# Banco postgres
db:
image: postgres:16
hostname: db
environment:
- POSTGRES_PASSWORD=999
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
- POSTGRES_HOST_AUTH_METHOD=trust
ports:
- "5432:5432" # Exposing is useful for debugging.
volumes:
- ./db/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
deploy:
resources:
limits:
cpus: "1.1"
memory: "480MB"
# 1.5 CPU, 550MB total