-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
31 lines (25 loc) · 897 Bytes
/
makefile
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
# Project variables
DOCKER_COMPOSE = docker-compose
DOCKER_COMPOSE_FILE = ./docker/docker-compose.yml
# Default target
.PHONY: help
help: ## Show this help message
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-20s %s\n", $$1, $$2}'
.PHONY: build
build: ## Build the Docker containers
$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) build --no-cache
.PHONY: up
up: ## Start the Docker containers
$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) up -d
.PHONY: logs
logs: ## Show the Docker containers logs
$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) logs -f
.PHONY: down
down: ## Stop the Docker containers
$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) down
.PHONY: php-migrate
php-migrate: ## Run the PHP migrations
$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) exec php php artisan migrate