forked from smartlook/smartlook-relay-proxy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
44 lines (39 loc) · 1.32 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
# help: Show this help
# find all lines with two # | and : | exclude fgrep | extract name and description | create table
help:
@echo
@echo "Smartlook Relay Proxy"
@echo
@fgrep -h "#" $(MAKEFILE_LIST) | fgrep : | fgrep -v fgrep | sed -e $$'s/#[[:blank:]]*\([^:]*\):\(.*\)/\\1##\\2/' | column -t -s '##'
@echo
# clean: Remove all local build files & clean node_modules
clean:
@echo "Cleaning build..."
rm -rf ./build; rm -rf ./node_modules;
docker-compose down
# dev: Start dev server in Docker
# dev: use 'build=yes' to rebuild (useful after installing new dependencies)
dev:
ifeq ($(build),yes)
@echo "Rebuilding and starting development server..."
docker-compose -f docker-compose.dev.yml up --build --remove-orphans
else
@echo "Starting development server..."
docker-compose -f docker-compose.dev.yml up
endif
# lint: Lint all files (runs ESLint & Prettier)
lint:
@echo "Linting..."
npm run lint
# build: Build Docker image for production
build:
@echo "Building for production..."
docker build -t smartlook-relay-proxy .
# up: Run Docker image in production mode. Specify local port by setting 'port=<number>'
up:
ifdef port
@echo "Running Docker image..."
docker run --env-file ./.env -d -p $(port):8000 --name smartlook-relay-proxy smartlook-relay-proxy
else
$(error port is required. Usage: 'make up port=<number>'')
endif