-
-
Save HeahDude/a0c94c77071b56328622302e2ea52720 to your computer and use it in GitHub Desktop.
Rebuild docker images only when they are modified
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DOCKER_FILES=$(shell find ./docker/dev/ -type f -name '*') | |
.DEFAULT_GOAL := help | |
.PHONY: help | |
help: | |
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/' | |
## | |
## Project setup | |
##--------------------------------------------------------------------------- | |
.PHONY: start | |
start: build up | |
.PHONY: reset | |
reset: clear start | |
.PHONY: clear | |
clear: | |
rm docker-dev.lock | |
## | |
# Internal rules | |
## | |
.PHONY: build | |
build: docker-dev.lock | |
docker-dev.lock: $(DOCKER_FILES) | |
$(DOCKER_COMPOSE) pull --parallel --ignore-pull-failures | |
$(DOCKER_COMPOSE) build --pull --force-rm | |
touch docker-dev.lock | |
.PHONY: up | |
up: | |
$(DOCKER_COMPOSE) up -d --remove-orphans |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment