-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
46 lines (46 loc) · 1.01 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
version: '3.7'
services:
db:
container_name: db_application
image: postgres
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USER}
POSTGRES_DB: ${DB_NAME}
volumes:
- pg_data:/var/lib/postgresql/data
# Uncomment if you want to load schema before migrations or any declarations
# - ./schema.sql:/docker-entrypoint-initdb.d/schema.sql
tty: true
ports:
- '54001:5432'
web:
container_name: web_application
build:
context: .
env_file: ./.env
depends_on:
- db
volumes:
- .:/app/
- /app/node_modules
ports:
- '5000:5000'
- 127.0.0.1:9223:9223
environment:
- DB_HOST=db_application
command: npm start
migration:
build:
context: .
command:
['./wait-for-it/wait-for-it.sh', 'db:5432', '--', 'npm', 'run', 'migrate']
links:
- db
depends_on:
- db
env_file: ./.env
environment:
- DB_HOST=db_application
volumes:
pg_data: null