-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
45 lines (42 loc) · 1.06 KB
/
docker-compose.yaml
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
version: "3"
services:
baroque:
image: "node:8"
user: "node"
working_dir: /home/node/app
environment:
- NODE_ENV=production
- POSTGRES_USER=baroque_user
- POSTGRES_PASSWORD=baroque_password
- POSTGRES_DB=baroque
volumes:
- .:/home/node/app
ports:
- 3000:3000
command: npm run start
depends_on:
- migration
baroque_db:
image: postgres
restart: always
ports:
- 5432:5432
environment:
- POSTGRES_USER=baroque_user
- POSTGRES_PASSWORD=baroque_password
- POSTGRES_DB=baroque
# The is added to ensure the migrations run as a separate service and not a regular thing to be done when server restarts
migration:
image: "node:8"
user: "node"
working_dir: /home/node/app
environment:
- NODE_ENV=production
- POSTGRES_USER=baroque_user
- POSTGRES_PASSWORD=baroque_password
- POSTGRES_DB=baroque
volumes:
- .:/home/node/app
command: npm run seed
depends_on:
- baroque_db