/
compose.yml
61 lines (59 loc) · 1.2 KB
/
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
version: "2.2"
services:
nginx:
environment:
NGINX_PORT: 80
build: ./config/nginx/
ports:
- "8080:80"
links:
- "api_1:api1"
- "api_2:api2"
depends_on:
- api_1
- api_2
api_1:
environment:
API_PORT: 8000
build:
context: .
depends_on:
db:
condition: service_healthy
links:
- "db:database"
api_2:
environment:
API_PORT: 8001
build:
context: .
depends_on:
db:
condition: service_healthy
links:
- "db:database"
db:
build: ./db/
restart: always
environment:
POSTGRES_USER: $DB_ADMIN_USER
POSTGRES_PASSWORD: $DB_ADMIN_PWD
POSTGRES_HOST_AUTH_METHOD: "scram-sha-256"
LANG: "pt_BR.utf8"
POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256 --locale-provider=icu --icu-locale=pt-BR"
TZ: 'Brazil/East'
PGTZ: 'Brazil/East'
env_file:
- .env
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $DB_ADMIN_USER"]
interval: 1s
timeout: 5s
retries: 10
ports:
- "5434:5432"
volumes:
- ./db/setup:/docker-entrypoint-initdb.d
- pgdata:/var/lib/postgresql/data
volumes:
pgdata: