Files
svn-log-tool/Makefile
T

33 lines
1.6 KiB
Makefile
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ============================================================
# Docker Hub 镜像代理(默认使用 docker.1ms.run 加速)
# 如果需要切换回 Docker Hub
# DOCKER_REGISTRY_MIRROR=docker.io/library make up
# ============================================================
DOCKER_REGISTRY_MIRROR ?= docker.1ms.run/library
.PHONY: up down status fast-up
COMPOSE_CMD := $(shell if command -v docker >/dev/null 2>&1 && docker compose version >/dev/null 2>&1; then echo "docker compose"; elif command -v docker-compose >/dev/null 2>&1; then echo "docker-compose"; fi)
BUILD_ENV := DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1
up:
@if [ -z "$(COMPOSE_CMD)" ]; then echo "docker compose/docker-compose not found"; exit 1; fi
@DOCKER_REGISTRY_MIRROR=$(DOCKER_REGISTRY_MIRROR) FAST_BUILD=false $(BUILD_ENV) $(COMPOSE_CMD) up -d --build
@echo "Application is starting at http://localhost:18088"
down:
@if [ -z "$(COMPOSE_CMD)" ]; then echo "docker compose/docker-compose not found"; exit 1; fi
@$(BUILD_ENV) $(COMPOSE_CMD) down
status:
@if [ -z "$(COMPOSE_CMD)" ]; then echo "docker compose/docker-compose not found"; exit 1; fi
@$(BUILD_ENV) $(COMPOSE_CMD) ps
@echo "Access URL: http://localhost:18088"
fast-up:
@if [ -z "$(COMPOSE_CMD)" ]; then echo "docker compose/docker-compose not found"; exit 1; fi
@echo "WARNING: fast-up is for Java incremental dev only."
@echo "WARNING: Use 'make up' if you changed frontend resources, or deleted/renamed Java files."
@DOCKER_REGISTRY_MIRROR=$(DOCKER_REGISTRY_MIRROR) FAST_BUILD=true $(BUILD_ENV) $(COMPOSE_CMD) up -d --build
@echo "Application is starting at http://localhost:18088"