-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
59 lines (55 loc) · 1.75 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
version: '3.8'
services:
db-local:
profiles:
- local
- infra
image: postgres:13
hostname: db-local
restart: unless-stopped
ports:
- '${DATABASE_PORT:?DATABASE_PORT env var is missing on .env file}:5432'
environment:
POSTGRES_DB: ${DATABASE_NAME:?DATABASE_NAME env var is missing on .env file}
POSTGRES_USER: ${DATABASE_USERNAME:?DATABASE_USERNAME env var is missing on .env file}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD:?DATABASE_PASSWORD env var is missing on .env file}
volumes:
- ./data/db-local:/var/lib/postgresql/data
db-test:
profiles:
- test
image: postgres:13
hostname: db-test
restart: unless-stopped
ports:
- '${DATABASE_PORT:?DATABASE_PORT env var is missing on .env file}:5432'
environment:
POSTGRES_DB: ${DATABASE_NAME:?DATABASE_NAME env var is missing on .env file}
POSTGRES_USER: ${DATABASE_USERNAME:?DATABASE_USERNAME env var is missing on .env file}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD:?DATABASE_PASSWORD env var is missing on .env file}
adminer:
profiles:
- local
- infra
image: adminer
hostname: adminer
restart: unless-stopped
ports:
- '${ADMINER_PORT:?ADMINER_PORT env var is missing on .env file}:8080'
depends_on:
- db-local
api-local:
profiles:
- local
build: .
command: ./wait-for.sh db-local:5432
hostname: api-local
restart: unless-stopped
ports:
- '${PORT:?PORT env var is missing on .env file}:${PORT}'
environment:
MODE: 'local'
PORT: '${PORT:?PORT env var is missing on .env}'
DATABASE_URL: 'postgresql://${DATABASE_USERNAME}:${DATABASE_PASSWORD}@db-local:5432/${DATABASE_NAME}'
depends_on:
- db-local