-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
39 lines (30 loc) · 1.01 KB
/
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
32
33
34
35
36
37
38
.PHONY: default
default: help
.PHONY: up
up: ## Build and start containers
mkdir -p node_modules
mkdir -p dist
docker compose up -d --build
.PHONY: build
build: ## Build the app container
docker compose build --no-cache --progress=plain
.PHONY: down
down: ## Stop and remove containers, networks, images, and volumes
docker compose down $(ARGS)
.PHONY: clean
clean: ## Remove all containers, networks, images, and volumes
make down ARGS="--rmi all --volumes"
docker builder prune -af
.PHONY: shell
shell: ## Access to the shell of the app docker container
docker compose exec app /bin/bash
.PHONY: install
install: ## Install dependencies
docker compose exec app npm install $(ARGS) --loglevel=verbose
.PHONY: test
test: ## Run tests
docker compose exec app npm test $(ARGS)
.PHONY: help
help:
@echo "Please use 'make <target>' where <target> is one of the following commands.\n"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'