diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3473d71 --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +# This Makefile is based on the Makefile defined in the Python Best Practices repository: +# https://git.datapunt.amsterdam.nl/Datapunt/python-best-practices/blob/master/dependency_management/ +# +# VERSION = 2020.01.29 +.PHONY: help pip-tools install requirements update test init + +UID:=$(shell id --user) +GID:=$(shell id --group) + +dc = docker compose +run = $(dc) run --rm -u ${UID}:${GID} + + +help: ## Show this help. + @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' + +build: ## Build docker image + $(dc) build + +push: build ## Push docker image to registry + $(dc) push + +push_semver: + VERSION=$${VERSION} $(MAKE) push + VERSION=$${VERSION%\.*} $(MAKE) push + VERSION=$${VERSION%%\.*} $(MAKE) push + +clean: ## Clean docker stuff + $(dc) down -v --remove-orphans + +app: + $(dc) up --build serve + +shell: + $(run) serve sh + diff --git a/docker-compose.yml b/docker-compose.yml index 120ae5c..f0a9b03 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,4 +5,5 @@ services: context: . ports: - 8095:80 + image: ${REGISTRY:-localhost:5001}/${REPOSITORY:-opdrachten/amaps}:${VERSION:-latest}