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