diff options
author | Cody Hiar <codyfh@gmail.com> | 2018-03-21 16:44:04 -0600 |
---|---|---|
committer | Cody Hiar <codyfh@gmail.com> | 2018-03-21 16:44:04 -0600 |
commit | fdceedd5b753b580e29771a3a5f46538ffd41393 (patch) | |
tree | 4999ea4146fc559ddcde4a2c9416cbb70bbcffc7 /{{cookiecutter.project_name}}/Makefile |
initial commit
Diffstat (limited to '{{cookiecutter.project_name}}/Makefile')
-rw-r--r-- | {{cookiecutter.project_name}}/Makefile | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/{{cookiecutter.project_name}}/Makefile b/{{cookiecutter.project_name}}/Makefile new file mode 100644 index 0000000..921561c --- /dev/null +++ b/{{cookiecutter.project_name}}/Makefile @@ -0,0 +1,22 @@ +.PHONY: build + +CONTAINERNAME={{cookiecutter.docker_namespace}}_{{cookiecutter.project_name}} +IMAGENAME={{cookiecutter.docker_namespace}}/{{cookiecutter.project_name}} + +help: + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +build: ## Build the Docker image + docker build -t $(IMAGENAME) ./docker + +up: build ## Bring the container up + docker run -dP -v $(CURDIR):/app --name $(CONTAINERNAME) $(IMAGENAME) /bin/bash -c '/opt/entry.sh' + +down: ## Stop the container + docker stop $(CONTAINERNAME) || echo 'No container to stop' + +enter: ## Enter the running container + docker exec -it $(CONTAINERNAME) /bin/bash + +clean: down ## Remove the image and any stopped containers + docker rm $(CONTAINERNAME) || echo 'No container to remove' |