Personal_Website/Makefile
2022-05-28 11:16:22 +02:00

34 lines
922 B
Makefile

DOCKER_REPOSITORY := daniel-website/nginx
DOCKER_TAG?="dev"
.DEFAULT_GOAL := help
.PHONY: help
help:
@printf "\033[33mUsage:\033[0m\n make [target] [arg=\"val\"...]\n\n\033[33mTargets:\033[0m\n"
@grep -E '^[-a-zA-Z0-9_\.\/]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-15s\033[0m %s\n", $$1, $$2}'
.PHONY: run
run: ## Start all docker containers using docker-compose
@docker-compose up -d
.PHONY: debug
debug: ## Start all docker containers using docker-compose. Attach to stdout
@docker-compose up
.PHONY: sh
sh: ## Start shell in docker container
@docker-compose exec vue bash
.PHONY: build-container
build-container: ## Build a release container
@docker build -t "${DOCKER_REPOSITORY}:${DOCKER_TAG}" -f docker/nginx/Dockerfile .
.PHONY: build
build: node_modules ## Build a release
@yarn build
node_modules: package.json yarn.lock
@yarn
@touch node_modules