-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (30 loc) · 898 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
# Makefile for Nuxt Docker Workflow
# Specify your Docker image name
IMAGE_NAME := frontend
# Build Docker image
build:
@docker build -t $(IMAGE_NAME) .
exec:
@docker exec -it $(IMAGE_NAME)-container /bin/bash
# Run Docker container with volume mount and host network
run: stop build
@docker run -d --rm --name $(IMAGE_NAME)-container \
-v $(PWD)/frontend:/src \
-p 3000:3000 \
-p 22301:22301 \
$(IMAGE_NAME)
@docker logs -f $(IMAGE_NAME)-container
# Stop and remove the running container
stop:
@docker stop $(IMAGE_NAME)-container || true
# Remove Docker image
clean: stop
@docker rmi $(IMAGE_NAME)
# Help
help:
@echo "Makefile commands:"
@echo "build - Build Docker image"
@echo "run - Run Docker container with volume mount and host network"
@echo "stop - Stop and remove the running container"
@echo "clean - Remove Docker image"
.PHONY: build run stop clean help