-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·41 lines (32 loc) · 716 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
IMAGE_NAME="elnygren/docker-nginx-autoreload"
CONTAINER_NAME="docker-nginx-autoreload"
# "public API"
.PHONY: start
start:
docker run -it --rm \
--name $(CONTAINER_NAME) -p 8080:80 \
-v $(PWD)/nginx.conf:/etc/nginx/nginx.conf \
$(IMAGE_NAME)
.PHONY: clean
clean: stop rm
.PHONY: validate
validate:
docker run --rm -t -a stdout \
-v $(PWD)/nginx.conf:/etc/nginx/nginx.conf:ro \
nginx:latest \
nginx -c /etc/nginx/nginx.conf -t
.PHONY: build
build:
docker build -t $(IMAGE_NAME) .
.PHONY: run
run:
docker run --name $(CONTAINER_NAME) -p 8080:80 -d $(IMAGE_NAME)
.PHONY: stop
stop:
docker stop $(CONTAINER_NAME)
.PHONY: rm
rm:
docker rm $(CONTAINER_NAME)
.PHONY: rmi
rmi:
docker rmi $(IMAGE_NAME)