Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2022-11-11 02:13:03 +0300
committerSarah German <sgerman@gitlab.com>2022-11-11 02:13:03 +0300
commit2e63b3ade88c60f835470a946f2a1fadd3fa807c (patch)
treebc5ef8207c263fa6d6d136fc8245324a5ea97c6b /dockerfiles
parente981394cf01e3b4febe16e8e179662b5aefd1700 (diff)
Build a Docker image with lunr.js enabled
Diffstat (limited to 'dockerfiles')
-rw-r--r--dockerfiles/single.Dockerfile9
1 files changed, 6 insertions, 3 deletions
diff --git a/dockerfiles/single.Dockerfile b/dockerfiles/single.Dockerfile
index 49c58393..1bebdbf8 100644
--- a/dockerfiles/single.Dockerfile
+++ b/dockerfiles/single.Dockerfile
@@ -26,11 +26,12 @@ COPY --from=minifier /minify /usr/local/bin/minify
# Set versions as build args to fetch corresponding branches
ARG VER
+ARG ALGOLIA_SEARCH
+ARG NANOC_ENV
ENV CI_COMMIT_REF_NAME=$VER
-
-# Set NANOC_ENV to production
-ENV NANOC_ENV=production
+ENV ALGOLIA_SEARCH=$ALGOLIA_SEARCH
+ENV NANOC_ENV=$NANOC_ENV
#
# Install Nanoc dependencies and tools that
@@ -78,6 +79,8 @@ RUN yarn install --frozen-lockfile \
&& bundle exec rake default \
&& bundle exec nanoc compile -VV
+RUN if [ "$ALGOLIA_SEARCH" = "false" ]; then make build-lunr-index; fi
+
# Move generated HTML to /site
RUN mkdir /site \
&& mv public "/site/${VER}"