Please provide the code changes or file diffs you would like me to summarize.
This commit is contained in:
@@ -1,22 +1,28 @@
|
||||
.PHONY: help build up down restart logs ps
|
||||
.PHONY: help build up up-build down restart logs ps
|
||||
|
||||
COMPOSE_FILE := docker/docker-compose.yml
|
||||
COMPOSE := docker compose -f $(COMPOSE_FILE)
|
||||
|
||||
help:
|
||||
@printf "Available targets:\n"
|
||||
@printf " make build Build Docker images\n"
|
||||
@printf " make up Build and start services in background\n"
|
||||
@printf " make down Stop and remove services\n"
|
||||
@printf " make restart Restart services\n"
|
||||
@printf " make logs Follow service logs\n"
|
||||
@printf " make ps Show service status\n"
|
||||
@printf " make build Build Docker images (with cache)\n"
|
||||
@printf " make up Start services (NO rebuild, reuse existing image)\n"
|
||||
@printf " make up-build Rebuild image then start (use after code changes)\n"
|
||||
@printf " make down Stop and remove services\n"
|
||||
@printf " make restart Restart services without rebuild\n"
|
||||
@printf " make logs Follow service logs\n"
|
||||
@printf " make ps Show service status\n"
|
||||
@printf " Note: do not use 'docker compose down -v' in daily usage (it removes persistent volumes)\n"
|
||||
|
||||
build:
|
||||
$(COMPOSE) build
|
||||
|
||||
# 日常启动:直接用已有镜像,不重新构建(秒启动)
|
||||
up:
|
||||
$(COMPOSE) up -d
|
||||
|
||||
# 代码有改动时使用:重新构建镜像再启动
|
||||
up-build:
|
||||
$(COMPOSE) build
|
||||
$(COMPOSE) up -d
|
||||
|
||||
@@ -24,8 +30,7 @@ down:
|
||||
$(COMPOSE) down
|
||||
|
||||
restart:
|
||||
$(COMPOSE) down
|
||||
$(COMPOSE) up -d
|
||||
$(COMPOSE) restart
|
||||
|
||||
logs:
|
||||
$(COMPOSE) logs -f
|
||||
|
||||
Reference in New Issue
Block a user