mirror of https://github.com/docker/docs.git
Dockerfile: remove "deploybase" stage, and inline instead
The "deploybase" stage was only used for the final stage. This patch inlines the steps from that stage to the final stage itself. In the process, changing the order of copying the NGINX configuration file to _after_ the docs were copied. This prevents having to copy the archived docs when making a change in the NGINX configuration. The NGINX configuration file _will_ now be copied on each rebuild, but the file is small, and as such is still faster than copying all archives. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
40e5ab6009
commit
ab9fe6e98e
16
Dockerfile
16
Dockerfile
|
|
@ -39,15 +39,6 @@ ARG DISTRIBUTION_BRANCH
|
||||||
ENV DISTRIBUTION_BRANCH=${DISTRIBUTION_BRANCH}
|
ENV DISTRIBUTION_BRANCH=${DISTRIBUTION_BRANCH}
|
||||||
|
|
||||||
|
|
||||||
# Base stage to be used for deploying the docs
|
|
||||||
FROM nginx:alpine AS deploybase
|
|
||||||
ENV TARGET=/usr/share/nginx/html
|
|
||||||
COPY _deploy/nginx/default.conf /etc/nginx/conf.d/default.conf
|
|
||||||
|
|
||||||
# Set the default command to serve the static HTML site
|
|
||||||
CMD echo -e "Docker docs are viewable at:\nhttp://0.0.0.0:4000"; exec nginx -g 'daemon off;'
|
|
||||||
|
|
||||||
|
|
||||||
# Empty stage if archives are disabled (ENABLE_ARCHIVES=false)
|
# Empty stage if archives are disabled (ENABLE_ARCHIVES=false)
|
||||||
FROM scratch AS archives-false
|
FROM scratch AS archives-false
|
||||||
|
|
||||||
|
|
@ -108,8 +99,13 @@ COPY --from=current /usr/share/nginx/html /
|
||||||
#
|
#
|
||||||
# To build without archives:
|
# To build without archives:
|
||||||
# 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 nginx:alpine AS deploy
|
||||||
|
ENV TARGET=/usr/share/nginx/html
|
||||||
WORKDIR $TARGET
|
WORKDIR $TARGET
|
||||||
|
|
||||||
COPY --from=archives / .
|
COPY --from=archives / .
|
||||||
COPY --from=current /usr/share/nginx/html .
|
COPY --from=current /usr/share/nginx/html .
|
||||||
|
|
||||||
|
# Configure NGINX
|
||||||
|
COPY _deploy/nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||||
|
CMD echo -e "Docker docs are viewable at:\nhttp://0.0.0.0:4000"; exec nginx -g 'daemon off;'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue