-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (31 loc) · 1.42 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
normal := \e[0m
bold := \e[1m
grey := \e[2m
node_version := 18
image_name := waxpacker
all: list
list:
@printf "$(bold)init$(grey) - Init project for development\n$(normal)"
@printf "$(bold)npm_install$(grey) - Install npm packages\n$(normal)"
@printf "$(bold)npm_update$(grey) - Update npm packages\n$(normal)"
@printf "$(bold)npm_upgrade$(grey) - Upgrade npm packages\n$(normal)"
@printf "$(bold)build$(grey) - Build production files\n$(normal)"
@printf "$(bold)build_docker_image$(grey) - Build docker image\n$(normal)"
@printf "$(bold)build_docker_image_alpine$(grey) - Build docker image alpine\n$(normal)"
init: copy_sample npm_install
copy_sample:
cp ./client/.env.local.example ./client/.env.local
npm_install:
docker run -it --rm -v ${PWD}/client:/app -w /app node:$(node_version) npm install
npm_update:
docker run -it --rm -v ${PWD}/client:/app -w /app node:$(node_version) npm update
docker run -it --rm -v ${PWD}/client:/app -w /app node:$(node_version) npm update -D
npm_upgrade:
docker run -it --rm -v ${PWD}/client:/app -w /app node:$(node_version) npx ncu -u
docker run -it --rm -v ${PWD}/client:/app -w /app node:$(node_version) npm install
build: npm_install
docker run -it --rm -v ${PWD}/client:/app -w /app node:$(node_version) npm run build
build_docker_image:
docker build -t ${image_name}:latest . --target=image
build_docker_image-alpine:
docker build -t ${image_name}:alpine . --target=image-alpine