-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
42 lines (32 loc) · 926 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
39
40
41
42
variables ?= .env
args = $(filter-out $@,$(MAKECMDGOALS))
include $(variables)
export $(shell sed 's/=.*//' $(variables))
#build:
# docker build \
# -f ./docker/Dockerfile \
# -t $(APP_NAME) \
# --build-arg NODE_ENV=$(NODE_ENV) \
# --build-arg PORT=$(APP_PORT) \
# .
run:
docker run -d -i \
--env-file $(variables) \
--name $(APP_NAME) \
-p 3000:3000 \
$(APP_NAME)
up: build run
stop:
docker-compose stop || true; docker-compose down || true
docker-compose stop || true; docker-compose down || true
test: stop
docker-compose -f docker-compose.test.yml up -d --build
/bin/sh -c "npm run test:e2e && npm run test:graphql"
docker-compose -f docker-compose.test.yml down
# DEVELOPMENT TASKS
install:
npm install $(args) --save
docker exec -it $(APP_NAME) npm install $(args) --save
uninstall:
npm uninstall $(args) --save
docker exec -it $(APP_NAME) npm uninstall $(args) --save