-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (30 loc) · 823 Bytes
/
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
# app name should be overridden.
# ex) production-stage: make build APP_NAME=<APP_NAME>
# ex) development-stage: make build-dev APP_NAME=<APP_NAME>
APP_NAME = typescript-express-container
APP_NAME := $(APP_NAME)
.PHONY: build
# Build the container image - Dvelopment
build-dev:
docker build -t ${APP_NAME}\
--target development-build-stage\
-f Dockerfile .
# Build the container image - Production
build:
docker build -t ${APP_NAME}\
--target production-build-stage\
-f Dockerfile .
# Build the whole environment, docker-composer
build-start:
docker-compose up --force-recreate
# Watch current work container
watch:
docker ps -a
# Clean the container image
clean:
docker rmi -f ${APP_NAME}
docker rm -f ${APP_NAME}
# Run the container image
run:
docker run -d -it -p 3000:3000 ${APP_NAME}
all: build