From 067a311acef03005c1c50f0c850a9c6d97f7f914 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Fri, 7 Oct 2022 10:46:51 +0200 Subject: Build a Docker image with lunr.js enabled --- dockerfiles/single.Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'dockerfiles') diff --git a/dockerfiles/single.Dockerfile b/dockerfiles/single.Dockerfile index 49c58393..ca96e568 100644 --- a/dockerfiles/single.Dockerfile +++ b/dockerfiles/single.Dockerfile @@ -26,8 +26,10 @@ COPY --from=minifier /minify /usr/local/bin/minify # Set versions as build args to fetch corresponding branches ARG VER +ARG ALGOLIA_SEARCH ENV CI_COMMIT_REF_NAME=$VER +ENV ALGOLIA_SEARCH=$ALGOLIA_SEARCH # Set NANOC_ENV to production ENV NANOC_ENV=production @@ -78,6 +80,8 @@ RUN yarn install --frozen-lockfile \ && bundle exec rake default \ && bundle exec nanoc compile -VV +RUN if [ "$ALGOLIA_SEARCH" = "false" ]; then echo "Building lunr.js..." && node scripts/lunr/preindex.js; fi + # Move generated HTML to /site RUN mkdir /site \ && mv public "/site/${VER}" -- cgit v1.2.3