-
-
Notifications
You must be signed in to change notification settings - Fork 667
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:added a makefile for streamlining the development process
- Loading branch information
1 parent
b6b0573
commit ca37ef3
Showing
1 changed file
with
24 additions
and
0 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,24 @@ | ||
# Makefile | ||
|
||
APP_NAME=asyncapi-website | ||
CONTAINER_NAME=asyncapi-website-container | ||
PORT=3000 | ||
|
||
# Build, Run, and Show Logs | ||
run: | ||
@echo "Building Docker image..." | ||
@docker build -t $(APP_NAME) . | ||
@echo "Stopping and removing any existing container..." | ||
@docker stop $(CONTAINER_NAME) || true | ||
@docker rm $(CONTAINER_NAME) || true | ||
@echo "Starting Docker container..." | ||
@docker run -d --name $(CONTAINER_NAME) -v "$$(pwd)":/async -p $(PORT):$(PORT) $(APP_NAME) | ||
@sleep 2 # Allow container to start | ||
@echo "Displaying Docker logs..." | ||
@docker logs -f $(CONTAINER_NAME) | ||
|
||
# Clean Docker Images | ||
clean: | ||
@echo "Cleaning up Docker images..." | ||
@docker rmi $(APP_NAME) || true | ||
@docker system prune -f || true |