Merge pull request #10351 from thaJeztah/use_local_nginx_conf

Dockerfile: use local nginx configuration
This commit is contained in:
Usha Mandya 2020-02-25 17:35:59 +00:00 committed by GitHub
commit f6b590cbb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View File

@ -39,13 +39,10 @@ ARG DISTRIBUTION_BRANCH
ENV DISTRIBUTION_BRANCH=${DISTRIBUTION_BRANCH}
# Reset to alpine so we don't get any docs source or extra apps
# Base stage to be used for deploying the docs
FROM nginx:alpine AS deploybase
ENV TARGET=/usr/share/nginx/html
# Get the nginx config from the nginx-onbuild image
# This hardly ever changes so should usually be cached
COPY --from=docs/docker.github.io:nginx-onbuild /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
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;'

View File

@ -0,0 +1,9 @@
server {
port_in_redirect off;
listen 4000;
error_page 403 404 /404.html;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
}