-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.prd
39 lines (27 loc) · 807 Bytes
/
Makefile.prd
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
.PHONY: restart prod
console:
@docker-compose -f docker-compose.prod.yml exec api node console.js
# Deploy
update: setupdb restart
pull:
@git fetch origin
@git reset --hard origin/master
restart:
@docker exec prod_api npm install
@docker exec prod_api npm run pm2-restart
# Production
up: prod nginx
prod: setupdb api
nginx:
@docker-compose -f docker-compose.prod.yml up -d nginx-proxy
@docker-compose -f docker-compose.prod.yml up -d nginx-letsencrypt
api:
@docker-compose -f docker-compose.prod.yml up --build -d api
setupdb: database migrate seed
database:
@docker-compose -f docker-compose.prod.yml up -d postgres
@sleep 3
migrate:
@docker-compose -f docker-compose.prod.yml run --rm api npm run migrate
seed:
@docker-compose -f docker-compose.prod.yml run --rm api npm run seed