feat: separate base image to make github action faster

This commit is contained in:
Tunghsiao Liu 2021-07-06 07:09:10 -04:00
parent 7bc83e6f4c
commit 5770064c68
No known key found for this signature in database
GPG Key ID: 1EC07B97513A7726
3 changed files with 33 additions and 8 deletions

View File

@ -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"]

10
Dockerfile.base Normal file
View File

@ -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

22
Makefile Normal file
View File

@ -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