From 2ef9b701096f0a8e55353f29fd86b2efdae938b9 Mon Sep 17 00:00:00 2001 From: Cody Hiar Date: Thu, 14 Jun 2018 09:08:06 -0600 Subject: Updating to docker compose --- {{cookiecutter.project_name}}/Makefile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to '{{cookiecutter.project_name}}/Makefile') diff --git a/{{cookiecutter.project_name}}/Makefile b/{{cookiecutter.project_name}}/Makefile index 921561c..804034d 100644 --- a/{{cookiecutter.project_name}}/Makefile +++ b/{{cookiecutter.project_name}}/Makefile @@ -1,22 +1,19 @@ .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 + docker-compose -p {{cookiecutter.project_name}} build up: build ## Bring the container up - docker run -dP -v $(CURDIR):/app --name $(CONTAINERNAME) $(IMAGENAME) /bin/bash -c '/opt/entry.sh' + docker-compose -p {{cookiecutter.project_name}} up -d down: ## Stop the container - docker stop $(CONTAINERNAME) || echo 'No container to stop' + docker-compose -p {{cookiecutter.project_name}} stop enter: ## Enter the running container - docker exec -it $(CONTAINERNAME) /bin/bash + docker-compose -p {{cookiecutter.project_name}} exec /bin/bash backend -clean: down ## Remove the image and any stopped containers - docker rm $(CONTAINERNAME) || echo 'No container to remove' +clean: down ## Remove stoped containers + docker-compose -p {{cookiecutter.project_name}} rm -- cgit v1.2.3