-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (42 loc) · 1.34 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
# app name should be overridden.
# ex) production-stage: make build APP_NAME=<APP_NAME>
# ex) development-stage: make build-dev APP_NAME=<APP_NAME>
SHELL := /bin/bash
APP_NAME = typescript-express
APP_NAME := $(APP_NAME)
.PHONY: help start clean db test
help:
@grep -E '^[1-9a-zA-Z_-]+:.*?## .*$$|(^#--)' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m %-43s\033[0m %s\n", $$1, $$2}' \
| sed -e 's/\[32m #-- /[33m/'
#-- Prisma
migrate-dev: ## migrate prisma dev changes
npm run prisma:migrate
generate: ## generate prisma dev client
npm run prisma:generate
pull: ## pull prisma dev changes
npm run prisma:pull
db-run: ## run prisma dev studio
npm run prisma:run
#-- Docker
up: ## Up the container images
docker-compose up -d
down: ## Down the container images
docker-compose down
build: ## Build the container image - Production
docker build -t ${APP_NAME}\
-f Dockerfile.prod .
build-dev: ## Build the container image - Dvelopment
docker build -t ${APP_NAME}\
-f Dockerfile.dev .
run: ## Run the container image
docker run -d -it -p 3000:3000 ${APP_NAME}
pause: ## Pause the containers
docker container rm -f ${APP_NAME}
clean: ## Clean the images
docker rmi -f ${APP_NAME}
remove: ## Remove the volumes
docker volume rm -f ${APP_NAME}
#-- Database
db: ## Start the local database MySQL
docker-compose up -d mysql