-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
67 lines (57 loc) · 1.81 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Makefile for the Inspector Application
#
# This Makefile provides convenient shortcuts for common Docker Compose commands
# to streamline the application development and deployment process.
# Variables
COMPOSE_FILE := docker-compose-dev.yml
DOCKER_COMPOSE := docker compose -f $(COMPOSE_FILE)
# Default target: start the application
.PHONY: up
up:
@echo "Starting the application..."
$(DOCKER_COMPOSE) up
# Stop the application and remove containers
.PHONY: down
down:
@echo "Stopping the application and removing containers..."
$(DOCKER_COMPOSE) down
# Build or rebuild services
.PHONY: build
build:
@echo "Building Docker images..."
$(DOCKER_COMPOSE) build
# Rebuild and start the application
.PHONY: rebuild
rebuild:
@echo "Rebuilding and starting the application..."
$(DOCKER_COMPOSE) up --build
# Stop and remove containers, networks, images, and volumes
.PHONY: clean
clean:
@echo "Cleaning up all resources..."
$(DOCKER_COMPOSE) down --volumes --remove-orphans
# Restart the application (down with volumes, then up with build)
.PHONY: restart
restart:
@echo "Restarting the application..."
$(DOCKER_COMPOSE) down --volumes
$(DOCKER_COMPOSE) up --build
# Display application logs
.PHONY: logs
logs:
@echo "Displaying application logs..."
$(DOCKER_COMPOSE) logs -f
# Show available make commands
.PHONY: help
help:
@echo "Usage: make [target]"
@echo ""
@echo "Available targets:"
@echo " up Start the application"
@echo " down Stop the application and remove containers"
@echo " build Build or rebuild services"
@echo " rebuild Rebuild and start the application"
@echo " restart Restart the application with a fresh build"
@echo " clean Remove containers, networks, images, and volumes"
@echo " logs Display application logs"
@echo " help Show this help message"