-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
alain
committed
Jan 3, 2025
1 parent
6b87748
commit 509ae15
Showing
2 changed files
with
38 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters