aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorCody Hiar <codyfh@gmail.com>2017-02-07 20:24:29 -0700
committerCody Hiar <codyfh@gmail.com>2017-02-07 20:24:29 -0700
commit58b4fb228c3f7583386ded86505cb10f2a870129 (patch)
treee75a46f789de741ac3fbf92ce797ad39809fc9c0 /Makefile
Just add stuff
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..d00ed5e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,22 @@
+.PHONY: build
+
+IMAGENAME=thornycrackers/python_daemon
+CONTAINERNAME=python_daemon
+
+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) ./build
+
+up: build ## Bring the Docker container up
+ docker run -dP -v $(CURDIR):/app --name $(CONTAINERNAME) $(IMAGENAME) /bin/bash -c '/opt/entry.sh'
+
+down: ## Stop the Docker container
+ docker stop $(CONTAINERNAME) || echo 'No container to stop'
+
+enter: ## Enter the running Docker container
+ docker exec -it $(CONTAINERNAME) /bin/bash
+
+clean: down ## Remove the Docker image and any stopped containers
+ docker rm $(CONTAINERNAME) || echo 'No container to remove'