forked from entrepreneur-interet-general/solidata_backend
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (55 loc) · 1.55 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
export APP=toktok
export D_FOLDER=docker-files
export DC_FOLDER=dockercomposes
export DF_FOLDER=dockerfiles
#other variable definition
# DC := docker-compose
# DF := Dockerfile.
export DC=docker-compose
export DF=Dockerfile.
export DC_PREFIX= $(shell pwd)/${DC}
export DC_PREFIX_FOLDER= $(shell pwd)/${D_FOLDER}/${DC_FOLDER}/${DC}
export DC_FOLDER_SUBPATH= ${D_FOLDER}/${DC_FOLDER}
export DF_FOLDER_SUBPATH= ${D_FOLDER}/${DF_FOLDER}
export APP_PATH := $(shell pwd)
export BACKEND=${APP_PATH}
export FRONTEND=${APP_PATH}
### ============ ###
### network
### ============ ###
network:
@docker network create ${APP} 2> /dev/null; true
network-stop:
docker network rm ${APP}
### ============ ###
### backend
### ============ ###
# dev
gunicorn-dev:
${DC} -f ${DC_PREFIX_FOLDER}-gunicorn-dev.yml up --build
gunicorn-dev-stop:
${DC} -f ${DC_PREFIX_FOLDER}-gunicorn-dev.yml down
# prod
gunicorn-prod:
${DC} -f ${DC_PREFIX_FOLDER}-gunicorn-prod.yml up --build -d
gunicorn-prod-stop:
${DC} -f ${DC_PREFIX_FOLDER}-gunicorn-prod.yml down
### ============================= ###
### main make / docker commands
### ============================= ###
# # dev
# up: network gunicorn-dev
# down: gunicorn-dev-stop network-stop
# restart: down up
# # prod
# up-prod: network gunicorn-prod
# down-prod: gunicorn-prod-stop network-stop
# restart-prod: down-prod up-prod
# dev
up: network gunicorn-dev
down: gunicorn-dev-stop network-stop
restart: down up
# prod
up-prod: network gunicorn-prod
down-prod: gunicorn-prod-stop network-stop
restart-prod: down-prod up-prod