-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (43 loc) · 1.02 KB
/
Makefile
File metadata and controls
53 lines (43 loc) · 1.02 KB
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
IMGNAME?=ghcr.io/libertech-fr/mailrest
APPNAME?=mailrest
APPPORT?=7200
init:
@docker build -t $(IMGNAME) .
@docker exec -it $(APPNAME) yarn install
build:
docker build -t $(IMGNAME) .
push:
docker push $(IMGNAME)
compile:
docker exec -it $(APPNAME) yarn build
dev:
@docker run -it --rm \
-e NODE_ENV=development \
-e NODE_TLS_REJECT_UNAUTHORIZED=0 \
--add-host host.docker.internal:host-gateway \
--name $(APPNAME) \
--network dev \
-p $(APPPORT):7200 \
-v $(CURDIR):/usr/src/app \
$(IMGNAME) yarn start:dev
exec:
@docker run -it --rm \
--add-host host.docker.internal:host-gateway \
-e NODE_ENV=development \
--network dev \
-v $(CURDIR):/usr/src/app \
$(IMGNAME) sh
generate:
@docker exec -it $(APPNAME) yarn generate
dbs:
@docker volume create $(APPNAME)-redis
@docker run -d --rm \
--name $(APPNAME)-redis \
--network dev \
-p 6379:6379 \
redis
stop:
@docker stop $(APPNAME) || true
@docker stop $(APPNAME)-redis || true
rm:
docker rm $(shell docker ps -a -q -f name=$(APPNAME))