diff options
author | Cody Hiar <codyfh@gmail.com> | 2018-03-19 21:30:32 -0600 |
---|---|---|
committer | Cody Hiar <codyfh@gmail.com> | 2018-03-19 21:30:32 -0600 |
commit | 3f5efcb91afc2e6d013800132b92e4a6c297f662 (patch) | |
tree | 3de0b3c6804ec51d5784d788b8df450eae208f1a /Makefile |
Initial commit of working files
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..902cb2f --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +.PHONY: build + +CONTAINERNAME=thornycrackers_scrapy_example +IMAGENAME=thornycrackers/scrapy_example + +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 + cp -r requirements.txt ./build + docker build -t $(IMAGENAME) ./build + +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' |