-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (24 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
SHELL = /bin/bash -e
# import a local .env file if it exists
-include .env
COMMON_FILE := docker-compose.yml
OVERRIDE_FILE := docker-compose.override.yml
DIRECT_FILE := docker-compose.direct.yml
export COMPOSE_FILE := $(COMMON_FILE):$(DIRECT_FILE)
config: ## Write environment configuration to console
docker compose config
pull: ## Pull latest container images
docker compose pull
up: ## Create all networks, containers, and volumes
docker compose config > $(OVERRIDE_FILE)
unset COMPOSE_FILE ; docker compose up --detach --remove-orphans
deploy: up ## Alias for 'up'
pull-up: pull up ## Alias for 'pull & up'
down: ## Remove all networks, containers, and images
docker compose down --remove-orphans --rmi all
clean: ## Remove local override file
-rm $(OVERRIDE_FILE)
help: ## Print help message
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
.PHONY: help config pull pull-up up down clean deploy
.DEFAULT_GOAL = help