-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
48 lines (38 loc) · 1.45 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
# Set default shell for commands to bash (important for some commands)
SHELL := /bin/bash
# Define your Docker Compose project name
COMPOSE_PROJECT_NAME := hoyolab-auto
# Define the Docker Compose file to use
COMPOSE_FILE := docker-compose.yml
# Target: build (Builds your Docker image)
build:
docker-compose -f $(COMPOSE_FILE) build
# Target: up (Starts your application in the background)
up:
docker-compose -f $(COMPOSE_FILE) up -d
# Target: down (Stops and removes containers, networks)
down:
docker-compose -f $(COMPOSE_FILE) down
# Target: restart (Restarts your application)
restart: down up
# Target: logs (Follows application logs)
logs:
docker-compose -f $(COMPOSE_FILE) logs -f instance
# Target: exec (Execute a command inside the running container)
exec:
docker-compose -f $(COMPOSE_FILE) exec instance bash
# Target: update (Rebuild and restart with latest changes)
update: build restart
# Target: help (Display help message)
help:
@echo "Usage: make <target>"
@echo ""
@echo "Targets:"
@echo " build Build the Docker image"
@echo " up Start the application in the background"
@echo " down Stop and remove containers, networks, volumes"
@echo " restart Restart the application (down & up)"
@echo " logs View application logs"
@echo " exec Open a Bash shell inside the running container"
@echo " update Rebuild the image and restart the application"
@echo " help Show this help message"