diff --git a/raniagus-docker-dashboard/.env.example b/raniagus-docker-dashboard/.env.example new file mode 100644 index 0000000..5612e34 --- /dev/null +++ b/raniagus-docker-dashboard/.env.example @@ -0,0 +1,2 @@ +IMAGE_TAG= +PORT= diff --git a/raniagus-docker-dashboard/.gitignore b/raniagus-docker-dashboard/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/raniagus-docker-dashboard/.gitignore @@ -0,0 +1 @@ +.env diff --git a/raniagus-docker-dashboard/Dockerfile b/raniagus-docker-dashboard/Dockerfile new file mode 100644 index 0000000..481624b --- /dev/null +++ b/raniagus-docker-dashboard/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine:latest + +ENTRYPOINT ["tail", "-f", "/dev/null"] diff --git a/raniagus-docker-dashboard/Makefile b/raniagus-docker-dashboard/Makefile new file mode 100644 index 0000000..fb78ffd --- /dev/null +++ b/raniagus-docker-dashboard/Makefile @@ -0,0 +1,35 @@ +include .env + +ifndef IMAGE_TAG +$(error IMAGE_TAG variable is not set. Ensure that an .env file is created and properly configured.) +endif + +CONTAINERS_RUNNING != docker container ls -q --filter ancestor=$(IMAGE_TAG) +CONTAINERS != docker container ls -aq --filter ancestor=$(IMAGE_TAG) + +all: build run + +build: + docker build . --rm -t $(IMAGE_TAG) + +run: + docker run -d --init --env-file=./.env $(if $(PORT),-p $(PORT):$(PORT)) $(IMAGE_TAG) + +stop: +ifdef CONTAINERS_RUNNING + docker container stop $(CONTAINERS_RUNNING) +endif + +clean: stop +ifdef CONTAINERS + -docker container rm $(CONTAINERS) +endif + -docker rmi $(IMAGE_TAG) + +exec: + docker exec -it $(word 1,$(CONTAINERS_RUNNING)) /bin/ash + +logs: + docker logs $(word 1,$(CONTAINERS_RUNNING)) -f + +.PHONY: all build run stop clean exec logs