-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
55 lines (41 loc) · 1.26 KB
/
Makefile
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
### cf : https://guillim.github.io/docker/2018/11/18/docker-hands-on-intro.html
### cf : https://jonathanmh.com/deploying-a-nuxt-js-app-with-docker/
### cf : https://dev.to/vuevixens/dockerise-your-nuxt-ssr-app-like-a-boss-a-true-vue-vixens-story-4mm6
### cf : https://github.com/sass/node-sass/issues/2165
### cf : https://stackoverflow.com/questions/54492385/nuxt-js-in-docker-missing-dependencies
export APP=apiviz-nuxt
#other variable definition
# DC := docker-compose
# DF := Dockerfile.
export DC=docker-compose
export DF=Dockerfile.
export APP_PATH := $(shell pwd)
### ============ ###
### network
### ============ ###
network:
@docker network create ${APP} 2> /dev/null; true
network-stop:
docker network rm ${APP}
### ============ ###
### frontend
### ============ ###
nuxt:
${DC} -f ${DC}-nuxt.yml up --build
nuxt-stop:
${DC} -f ${DC}-nuxt.yml down
nuxt-prod:
${DC} -f ${DC}-nuxt-prod.yml up --build -d
nuxt-prod-stop:
${DC} -f ${DC}-nuxt-prod.yml down
### ============================= ###
### main make / docker commands
### ============================= ###
# nuxt building
up: network nuxt
down: nuxt-stop network-stop
restart: down up
# nuxt building
up-prod: network nuxt-prod
down-prod: nuxt-prod-stop network-stop
restart-prod: down-prod up-prod