|
| 1 | +# Executables (local) |
| 2 | +DOCKER_COMP = docker compose |
| 3 | + |
| 4 | +# Docker containers |
| 5 | +NODE_CONT = $(DOCKER_COMP) exec nuxt |
| 6 | + |
| 7 | +# Executables |
| 8 | +NPX = $(NODE_CONT) npx nuxi |
| 9 | +NPM = $(NODE_CONT) npm |
| 10 | + |
| 11 | +# Misc |
| 12 | +.DEFAULT_GOAL = help |
| 13 | +.PHONY : help build up start down logs sh composer vendor sf cc test consolidate install |
| 14 | + |
| 15 | +## —— 🎵 🐳 The Symfony Docker Makefile 🐳 🎵 —————————————————————————————————— |
| 16 | +help: ## Outputs this help screen |
| 17 | + @grep -E '(^[a-zA-Z0-9\./_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/' |
| 18 | + |
| 19 | +## —— Docker 🐳 ———————————————————————————————————————————————————————————————— |
| 20 | +build: ## Builds the Docker images |
| 21 | + @$(DOCKER_COMP) build --pull --no-cache |
| 22 | + |
| 23 | +up: ## Start the docker hub in detached mode (no logs) |
| 24 | + @$(DOCKER_COMP) up --detach |
| 25 | + |
| 26 | +install: ## Start the docker hub in detached mode (no logs) |
| 27 | + @$(DOCKER_COMP) run --rm --entrypoint bash nuxt -c "npm install" |
| 28 | + |
| 29 | +start: build up ## Build and start the containers |
| 30 | + |
| 31 | +down: ## Stop the docker hub |
| 32 | + @$(DOCKER_COMP) down --remove-orphans |
| 33 | + |
| 34 | +logs: ## Show live logs |
| 35 | + @$(DOCKER_COMP) logs --tail=0 --follow |
| 36 | + |
| 37 | +sh: ## Connect to the FrankenPHP container |
| 38 | + @$(NODE_CONT) sh |
| 39 | + |
| 40 | +bash: ## Connect to the FrankenPHP container via bash so up and down arrows go to previous commands |
| 41 | + @$(NODE_CONT) bash |
| 42 | + |
| 43 | +## —— NPM 🧙 —————————————————————————————————————————————————————————————— |
| 44 | +npx: ## Run 'npx nuxi', pass the parameter "c=" to run a given command, example: make composer c='prepare' |
| 45 | + @$(eval c ?=) |
| 46 | + @$(NPX) $(c) |
| 47 | + |
| 48 | +npm: ## Run npm, pass the parameter "c=" to run a given command, example: make composer c='install' |
| 49 | + @$(eval c ?=) |
| 50 | + @$(NPM) $(c) |
| 51 | + |
| 52 | +## —— AI 🧠 ——————————————————————————————————————————————————————————————— |
| 53 | +consolidate: |
| 54 | + @consolidate --ext=ts,vue,css,json,yaml,Dockerfile,md --exclude=package-lock.json,README.md,'*/.nuxt/*','*/.output/*','*/.data/*','*/docs/*' |
| 55 | + @cp ../hskstudykit-backend/docs/api.md api.txt |
0 commit comments