Dockerfile: don't use intermediate "deploy-source" stage

The "deploy-source" stage was added in a previous refactor. While
this stage is useful to "export" all docs (including archives if
needed), and _convenient_ to collect all those files to the final
stage, it caused a regression in performance.

This patch changes the final ("deploy") to copy the "archives" and
"current" docs separately, so that the archived versions can be
cached in the final stage, and don't have to be copied again on
each rebuild.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-02-28 13:43:34 +01:00
parent 7d22d25adf
commit 40e5ab6009
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 3 additions and 1 deletions

View File

@ -110,4 +110,6 @@ COPY --from=current /usr/share/nginx/html /
# DOCKER_BUILDKIT=1 docker build -t docs --build-arg ENABLE_ARCHIVES=false . # DOCKER_BUILDKIT=1 docker build -t docs --build-arg ENABLE_ARCHIVES=false .
FROM deploybase AS deploy FROM deploybase AS deploy
WORKDIR $TARGET WORKDIR $TARGET
COPY --from=deploy-source / .
COPY --from=archives / .
COPY --from=current /usr/share/nginx/html .