-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
63 lines (48 loc) · 1.77 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
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
# Alexander Tebiev - https://github.com/beeyev/thumbor-s3-docker
export DOCKER_BUILDKIT?=1
export COMPOSE_CONVERT_WINDOWS_PATHS?=1
export TZ?=UTC
export BUILD_DATE?=$(shell TZ=":UTC" date '+%Y-%m-%d %H:%M:%S (%Z)')
.EXPORT_ALL_VARIABLES:
.PHONY: *
.DEFAULT_GOAL := help
THIS_FILE := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
ifeq (,$(shell command docker compose 2> /dev/null))
DOCKER_COMPOSE_COMMAND = docker-compose
else
DOCKER_COMPOSE_COMMAND = docker compose
endif
help: ## Show this help
@echo "Make Application Docker Images and Containers using Docker-Compose files in 'docker' Dir."
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m (default: help)\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-12s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
up: ## Docker compose up
$(DOCKER_COMPOSE_COMMAND) up --build --no-deps --detach --remove-orphans
start:
make up
down: ## Docker compose down
$(DOCKER_COMPOSE_COMMAND) down --remove-orphans
stop: ## Docker compose stop
$(DOCKER_COMPOSE_COMMAND) stop
restart: ## Restart containers
make down
make up
$(info Restart completed)
update: ## Update containers
$(DOCKER_COMPOSE_COMMAND) pull
make up
destroy: ## Destroy containers/volumes (keep sources app folders)
make stop
$(DOCKER_COMPOSE_COMMAND) down --rmi all --remove-orphans
rebuild: ## Rebuild docker container (destroy & upgrade)
make destroy
make up
state: ## Show current state
docker ps --format=table
logs: ## Show docker logs
$(DOCKER_COMPOSE_COMMAND) logs -f --tail=100 $(ARGS)
thumbor: ## Thumbor Container shell
docker-compose exec thumbor bash
#docker-compose exec -u root thumbor bash
minio: ## Minio Container shell
docker-compose exec minio bash