2022-11-24 13:32:59 +01:00
|
|
|
#//////////////////////////////////////////////////////////////
|
|
|
|
#// //
|
2024-05-05 18:14:41 +02:00
|
|
|
#// Infrastructure, 2024 //
|
2022-11-24 13:32:59 +01:00
|
|
|
#// Created: 14, April, 2022 //
|
2024-05-05 18:14:41 +02:00
|
|
|
#// Modified: 05, May, 2024 //
|
2022-11-24 13:32:59 +01:00
|
|
|
#// file: - //
|
|
|
|
#// - //
|
|
|
|
#// Source: //
|
|
|
|
#// OS: ALL //
|
|
|
|
#// CPU: ALL //
|
|
|
|
#// //
|
|
|
|
#//////////////////////////////////////////////////////////////
|
|
|
|
|
2024-09-12 00:07:08 +02:00
|
|
|
SERVER_DIRECTORY := infrastructure
|
|
|
|
|
2022-11-24 13:32:59 +01:00
|
|
|
DOCKER := docker
|
|
|
|
|
2024-09-08 13:55:28 +02:00
|
|
|
BLOG_SERVICES := wordpress
|
2024-08-28 23:31:13 +02:00
|
|
|
TORRENTS_SERVICES := qbittorrent transmission
|
2024-09-08 13:55:28 +02:00
|
|
|
SHARING_SERVICES := psitransfer picoshare privatebin projectsend jellyfin dufs gitea syncthing
|
2024-09-09 21:49:42 +02:00
|
|
|
ADMIN_SERVICES := yacht uptime-kuma adminer openssh
|
2024-09-03 23:54:40 +02:00
|
|
|
UTILS_SERVICES := it-tools stirlingpdf
|
2024-09-08 13:55:28 +02:00
|
|
|
# gitea-runner
|
2024-08-28 23:31:13 +02:00
|
|
|
|
2024-09-09 21:49:42 +02:00
|
|
|
PROFILES := main_infrastructure caddy homepage $(BLOG_SERVICES) $(SHARING_SERVICES) $(TORRENTS_SERVICES) $(ADMIN_SERVICES) $(UTILS_SERVICES)
|
2023-03-17 22:38:48 +01:00
|
|
|
PROFILE_CMD := $(addprefix --profile ,$(PROFILES))
|
2022-11-24 13:32:59 +01:00
|
|
|
|
2024-09-16 00:07:41 +02:00
|
|
|
COMPOSE_FILES := $(shell find ./$(SERVER_DIRECTORY) -name 'docker-compose*.yml' -type f | sed -e 's/^/--file /')
|
2024-09-12 00:07:08 +02:00
|
|
|
COMPOSE_DIR := --project-directory ./$(SERVER_DIRECTORY)
|
2022-11-24 13:32:59 +01:00
|
|
|
|
2024-09-08 13:55:28 +02:00
|
|
|
UID := 1000
|
|
|
|
GID := 1000
|
|
|
|
|
2024-09-08 15:19:48 +02:00
|
|
|
ENV_ARG_VAR := PUID=$(UID) PGID=$(GID)
|
2024-09-08 13:55:28 +02:00
|
|
|
|
2024-09-09 21:49:42 +02:00
|
|
|
DOCKER_COMPOSE_COMMAND := $(ENV_ARG_VAR) $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD)
|
|
|
|
|
2022-11-24 13:32:59 +01:00
|
|
|
.PHONY: build all
|
|
|
|
all: start
|
|
|
|
|
|
|
|
.PHONY: build
|
|
|
|
build:
|
2024-09-09 21:49:42 +02:00
|
|
|
$(DOCKER_COMPOSE_COMMAND) build
|
2022-11-24 13:32:59 +01:00
|
|
|
|
|
|
|
.PHONY: start
|
|
|
|
start:
|
2024-09-09 21:49:42 +02:00
|
|
|
$(DOCKER_COMPOSE_COMMAND) up -d
|
2022-11-24 13:32:59 +01:00
|
|
|
|
2023-03-17 22:38:48 +01:00
|
|
|
.PHONY: start-at
|
2022-11-24 13:32:59 +01:00
|
|
|
start-at:
|
2024-09-09 21:49:42 +02:00
|
|
|
$(DOCKER_COMPOSE_COMMAND) up
|
2023-03-17 22:38:48 +01:00
|
|
|
|
|
|
|
.PHONY: docker-check
|
|
|
|
docker-check:
|
2024-09-09 21:49:42 +02:00
|
|
|
$(DOCKER_COMPOSE_COMMAND) config
|
2022-11-24 13:32:59 +01:00
|
|
|
|
|
|
|
.PHONY: stop
|
|
|
|
stop: down
|
|
|
|
|
|
|
|
.PHONY: down
|
|
|
|
down:
|
2024-09-09 21:49:42 +02:00
|
|
|
$(DOCKER_COMPOSE_COMMAND) down
|
2022-11-24 13:32:59 +01:00
|
|
|
|
|
|
|
.PHONY: restart
|
|
|
|
restart: stop start
|
|
|
|
|
|
|
|
.PHONY: logs
|
|
|
|
logs:
|
2024-09-09 21:49:42 +02:00
|
|
|
$(DOCKER_COMPOSE_COMMAND) logs
|
2022-11-24 13:32:59 +01:00
|
|
|
|
|
|
|
.PHONY: state
|
|
|
|
state:
|
2024-09-09 21:49:42 +02:00
|
|
|
$(DOCKER_COMPOSE_COMMAND) ps
|
|
|
|
$(DOCKER_COMPOSE_COMMAND) top
|
2022-11-24 13:32:59 +01:00
|
|
|
|
2024-05-05 22:38:14 +02:00
|
|
|
.PHONY: update-docker
|
|
|
|
update-docker:
|
2024-09-09 21:49:42 +02:00
|
|
|
$(DOCKER_COMPOSE_COMMAND) pull
|
2024-05-05 22:38:14 +02:00
|
|
|
|
|
|
|
.PHONY: update
|
|
|
|
update: update-docker
|
2024-08-23 14:12:41 +02:00
|
|
|
git submodule update --init --recursive --remote
|
|
|
|
git pull --recurse-submodules --all --progress
|
2022-11-24 13:32:59 +01:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2024-09-09 21:49:42 +02:00
|
|
|
docker system prune -f
|
2022-11-24 13:32:59 +01:00
|
|
|
|
|
|
|
.PHONY: purge
|
|
|
|
purge:
|
2024-09-09 21:49:42 +02:00
|
|
|
$(ENV_ARG_VAR) $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) down -v --rmi all
|