-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (29 loc) · 1.03 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
IMAGENAME=mbeghelli/console
CONTAINERNAME="console"
NGINXPORT=80
TIMEZONE=Europe/Paris
help:
@echo "-------------------------------------------------------------"
@echo "console"
@echo "-------------------------------------------------------------"
@echo "make clean : clean docker container and image"
@echo "make build : build docker container"
@echo "make run : run docker container"
@echo "make stop : stop docker container"
@echo "make exec : open session inside docker container"
@echo "make logs : get logs of docker container"
@echo "make tests : test instance"
@echo "-------------------------------------------------------------"
clean: stop
-docker rm $(CONTAINERNAME) # docker container
-docker rmi $(IMAGENAME) # docker image
build: clean
docker build -t $(IMAGENAME) .
run:
docker run -d -e "TZ=$(TIMEZONE)" --name $(CONTAINERNAME) -p $(NGINXPORT):$(NGINXPORT) $(IMAGENAME)
stop:
-docker stop -t0 $(CONTAINERNAME)
exec:
docker exec -it $(CONTAINERNAME) /bin/bash
logs:
docker logs $(CONTAINERNAME)