-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
91 lines (69 loc) · 2.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#//////////////////////////////////////////////////////////////
#// //
#// Infrastructure, 2024 //
#// Created: 14, April, 2022 //
#// Modified: 05, May, 2024 //
#// file: - //
#// - //
#// Source: //
#// OS: ALL //
#// CPU: ALL //
#// //
#//////////////////////////////////////////////////////////////
SERVER_DIRECTORY := infrastructure
DOCKER := docker
BLOG_SERVICES := wordpress
TORRENTS_SERVICES := qbittorrent transmission
SHARING_SERVICES := psitransfer picoshare privatebin projectsend jellyfin dufs gitea syncthing
ADMIN_SERVICES := yacht uptime-kuma adminer openssh
UTILS_SERVICES := it-tools stirlingpdf
# gitea-runner
PROFILES := main_infrastructure caddy homepage $(BLOG_SERVICES) $(SHARING_SERVICES) $(TORRENTS_SERVICES) $(ADMIN_SERVICES) $(UTILS_SERVICES)
PROFILE_CMD := $(addprefix --profile ,$(PROFILES))
COMPOSE_FILES := $(shell find ./$(SERVER_DIRECTORY) -name 'docker-compose*.yml' -type f | sed -e 's/^/--file /')
COMPOSE_DIR := --project-directory ./$(SERVER_DIRECTORY)
UID := 1000
GID := 1000
ENV_ARG_VAR := PUID=$(UID) PGID=$(GID)
DOCKER_COMPOSE_COMMAND := $(ENV_ARG_VAR) $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD)
.PHONY: build all
all: start
.PHONY: build
build:
$(DOCKER_COMPOSE_COMMAND) build
.PHONY: start
start:
$(DOCKER_COMPOSE_COMMAND) up -d
.PHONY: start-at
start-at:
$(DOCKER_COMPOSE_COMMAND) up
.PHONY: docker-check
docker-check:
$(DOCKER_COMPOSE_COMMAND) config
.PHONY: stop
stop: down
.PHONY: down
down:
$(DOCKER_COMPOSE_COMMAND) down
.PHONY: restart
restart: stop start
.PHONY: logs
logs:
$(DOCKER_COMPOSE_COMMAND) logs
.PHONY: state
state:
$(DOCKER_COMPOSE_COMMAND) ps
$(DOCKER_COMPOSE_COMMAND) top
.PHONY: update-docker
update-docker:
$(DOCKER_COMPOSE_COMMAND) pull
.PHONY: update
update: update-docker
git submodule update --init --recursive --remote
git pull --recurse-submodules --all --progress
.PHONY: clean
clean:
docker system prune -f
.PHONY: purge
purge:
$(ENV_ARG_VAR) $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) down -v --rmi all