Skip to content

Commit

Permalink
feat:added a makefile for streamlining the development process
Browse files Browse the repository at this point in the history
  • Loading branch information
YashGupt29 committed Nov 20, 2024
1 parent b6b0573 commit ca37ef3
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Makefile
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

0 comments on commit ca37ef3

Please sign in to comment.