-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (44 loc) · 1.83 KB
/
Copy pathMakefile
File metadata and controls
64 lines (44 loc) · 1.83 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
SERVICE ?= 'app'
DOCKER_COMPOSE=$(if $(shell which docker compose),docker compose,docker-compose)
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "⚡ \033[34m%-30s\033[0m %s\n", $$1, $$2}'
all: build run
build: ## Build docker image
$(DOCKER_COMPOSE) build --no-cache
composer-install: ## Composer install dependencies
$(DOCKER_COMPOSE) exec --user www app sh -c "composer install"
start: run
run: ## Run application in Docker. Run 'make build' first
$(DOCKER_COMPOSE) up -d
restart: ## Restart service containers
$(DOCKER_COMPOSE) restart
stop: ## Force stop service containers
$(DOCKER_COMPOSE) kill
down: destroy
destroy: ## Alias docker-compose down command
$(DOCKER_COMPOSE) down
shell: ## Enter bash in running Docker container
$(DOCKER_COMPOSE) exec --user www app sh
root: ## Enter bash in running Docker container as root user
$(DOCKER_COMPOSE) exec --user root app sh
ps: status ## View services status
status:
$(DOCKER_COMPOSE) ps
logs: ## Show service container logs
$(DOCKER_COMPOSE) logs -f $(SERVICE)
redis-cli: ## Connect redis cli
$(DOCKER_COMPOSE) exec redis redis-cli
mysql-cli: ## Connect mysql cli
$(DOCKER_COMPOSE) exec mysql bash
psql-cli: ## Connect postgresql cli
$(DOCKER_COMPOSE) exec pgsql bash
npm-install-force: ### Install node packages with force option
$(DOCKER_COMPOSE) run --rm static-builder npm install --force
npm-dev: ### Bundle assets for development
$(DOCKER_COMPOSE) run --rm static-builder npm run dev
npm-build: ### Bundle assets for production within Symfony
$(DOCKER_COMPOSE) run --rm static-builder npm run build
npm-prod: ### Bundle assets for production within Laravel
$(DOCKER_COMPOSE) run --rm static-builder npm run prod
npm-watch: ### Watcher assets for development
$(DOCKER_COMPOSE) run --rm static-builder npm run watch