-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (51 loc) · 2.13 KB
/
Copy pathMakefile
File metadata and controls
69 lines (51 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.PHONY: help dev up-dev down-dev prod up-prod down-prod build-dev build-prod logs rebuild-dev clean
# Default to displaying help
.DEFAULT_GOAL := help
# Colors for help text
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
RESET := $(shell tput -Txterm sgr0)
##
## 🚜 Sprout Local Development
##---------------------------------------------------------------------------
dev: ## Run the development environment (with hot-reloading)
docker compose -f docker-compose.dev.yml up
up-dev: ## Run the development environment in detached mode
docker compose -f docker-compose.dev.yml up -d
down-dev: ## Stop and remove the development environment containers
docker compose -f docker-compose.dev.yml down
build-dev: ## Force rebuild development images without cache
docker compose -f docker-compose.dev.yml build --no-cache
rebuild-dev: down-dev build-dev up-dev ## Down, rebuild without cache, and up-dev
##
## 🚀 Production / Standard
##---------------------------------------------------------------------------
prod: ## Run the production environment
docker compose up
up-prod: ## Run the production environment in detached mode
docker compose up -d
down-prod: ## Stop and remove the production containers
docker compose down
build-prod: ## Force rebuild production images without cache
docker compose build --no-cache
##
## 🛠️ Utilities
##---------------------------------------------------------------------------
logs: ## Tail logs for all containers
docker compose logs -f
logs-dev: ## Tail logs for dev containers
docker compose -f docker-compose.dev.yml logs -f
clean: ## Remove stopped containers, unused networks, dangling images, and build cache
docker system prune -f
docker volume prune -f
help: ## Show this help message
@echo ''
@echo 'Usage:'
@echo ' ${YELLOW}make${RESET} ${GREEN}<target>${RESET}'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} { \
if (/^[a-zA-Z_-]+:.*?##.*$$/) {printf " ${YELLOW}%-20s${GREEN}%s${RESET}\n", $$1, $$2} \
else if (/^## .*$$/) {printf " ${WHITE}%s${RESET}\n", substr($$1,4)} \
}' $(MAKEFILE_LIST)