Skip to content

Commit

Permalink
Añadido: raniagus-docker-dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
RaniAgus committed Feb 8, 2023
1 parent 6ee17e6 commit d95371e
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions raniagus-docker-dashboard/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
IMAGE_TAG=
PORT=
1 change: 1 addition & 0 deletions raniagus-docker-dashboard/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
3 changes: 3 additions & 0 deletions raniagus-docker-dashboard/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine:latest

ENTRYPOINT ["tail", "-f", "/dev/null"]
35 changes: 35 additions & 0 deletions raniagus-docker-dashboard/Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d95371e

Please sign in to comment.