From a52fc338c97c4bbb5d214cb178960b030bedec1e Mon Sep 17 00:00:00 2001 From: shooter-dev Date: Thu, 8 Oct 2026 06:23:34 +0200 Subject: [PATCH] add makefile --- makefile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 makefile diff --git a/makefile b/makefile new file mode 100644 index 0000000..9f71f3a --- /dev/null +++ b/makefile @@ -0,0 +1,31 @@ +PYTHON ?= python3 +DOCKER ?= docker +DOCKER_COMPOSE ?= $(DOCKER) compose -f docker-compose.yml + +RUNTIME_LIBS := libs/mangacollec libs/mangacollec-store libs/container +RUNTIME_WHEEL_DIR := _dist/ +API_IMAGE := booksync-api:latest +WORKER_IMAGE := booksync-worker:latest +DASH_IMAGE := booksync-dash:latest + +.PHONY: build_libs build_api build_worker build_dash run_dash run_docker +build_libs: + @mkdir -p "$(RUNTIME_WHEEL_DIR)" && find "$(RUNTIME_WHEEL_DIR)" -maxdepth 1 -type f -name '*.whl' -exec trash {} + + $(PYTHON) -m pip wheel --no-deps --wheel-dir="$(RUNTIME_WHEEL_DIR)" $(RUNTIME_LIBS) + +########## DOCKER ###################################################################################################### +build_api: build_libs + $(DOCKER) build --tag "$(API_IMAGE)" --file booksync-api/Dockerfile . + +build_worker: build_libs + $(DOCKER) build --tag "$(WORKER_IMAGE)" --file booksync-worker/Dockerfile . + +build_dash: + $(DOCKER) build --tag "$(DASH_IMAGE)" --file booksync-dash/Dockerfile . + +run_dash: + $(DOCKER_COMPOSE) up --no-deps --no-recreate --no-build --pull never dash + +run_docker: build_worker build_api build_dash + $(DOCKER_COMPOSE) down + $(DOCKER_COMPOSE) up --build -d