-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
34 lines (27 loc) · 1002 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
IMAGE_NAME = pizza-waiter
CUSTOM_PORT ?= 3000
# Build the Docker image for production
build:
docker build --no-cache -t $(IMAGE_NAME):prod -f Dockerfile .
# Run the Docker container for production
prod: build
docker run -d -p $(CUSTOM_PORT):3000 --name $(IMAGE_NAME)_prod $(IMAGE_NAME):prod
# Stop the production container
stop:
docker stop $(IMAGE_NAME)_prod
# Remove the production container
clean:
docker rm $(IMAGE_NAME)_prod
# Remove the production image
clean-image:
docker rmi $(IMAGE_NAME):prod
# Help command to display available targets
help:
@echo "Available targets:"
@echo " build - Build the Docker image for production"
@echo " prod - Run the Docker container for production"
@echo " stop - Stop the production container"
@echo " clean - Remove the production container"
@echo " clean-image - Remove the production image"
@echo " help - Display this help message"
.PHONY: build production stop clean clean-image help