From 5770064c680e4631376067fd9e3bbe31347b7c10 Mon Sep 17 00:00:00 2001 From: Tunghsiao Liu Date: Tue, 6 Jul 2021 07:09:10 -0400 Subject: [PATCH] feat: separate base image to make github action faster --- Dockerfile | 9 +-------- Dockerfile.base | 10 ++++++++++ Makefile | 22 ++++++++++++++++++++++ 3 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 Dockerfile.base create mode 100644 Makefile diff --git a/Dockerfile b/Dockerfile index 77dd118..b85ff37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,7 @@ -FROM algolia/docsearch-scraper:latest +FROM openbayes/docsearch-scraper-action-base LABEL maintainer="t@sparanoid.com" -# Get rid of /github/home -# https://stackoverflow.com/a/63144407/412385 -ENV WORKON_HOME /root -ENV PIPENV_PIPFILE /root/Pipfile - -RUN pipenv install - COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/Dockerfile.base b/Dockerfile.base new file mode 100644 index 0000000..d36aa0a --- /dev/null +++ b/Dockerfile.base @@ -0,0 +1,10 @@ +FROM algolia/docsearch-scraper:latest + +LABEL maintainer="t@sparanoid.com" + +# Get rid of /github/home +# https://stackoverflow.com/a/63144407/412385 +ENV WORKON_HOME /root +ENV PIPENV_PIPFILE /root/Pipfile + +RUN pipenv install diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..91ff8f0 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +all: build + +build-base: + docker build -f Dockerfile.base -t openbayes/docsearch-scraper-action-base:latest . + +build: + docker build -t openbayes/docsearch-scraper-action:latest . + +run: + docker run --rm -it --name docsearch-scraper-action openbayes/docsearch-scraper-action:latest + +push-base: + docker push openbayes/docsearch-scraper-action-base:latest + +push: + docker push openbayes/docsearch-scraper-action:latest + +stop: + docker rm -f docsearch-scraper-action + +clean: + docker rmi openbayes/docsearch-scraper-action:latest