Commit 9757ff9e authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Reduce the size of the Nginx image

parent 80ead544
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
# syntax = docker/dockerfile:1.0-experimental

## Stage Nginx
ARG nginx_version=latest
FROM nginx:${nginx_version} as nginx
LABEL uk.org.kodo.maintainer = "Dom Sekotill <dom.sekotill@kodo.org.uk>"
FROM nginx:${nginx_version} as nginx-stage
ENV STAGE=/stage
COPY --from=docker.kodo.org.uk/kodo.org.uk/docker/docker-build-helpers:latest \
    /scripts /bin
RUN config-nsswitch nginx
RUN collect-binaries /usr/sbin/nginx
# Don't need nginx modules currently
# RUN collect-binaries /etc/nginx/modules/*
RUN mkdir -p $STAGE/var/log/nginx $STAGE/var/cache/nginx
RUN ln -s /dev/stderr $STAGE/var/log/nginx/error.log

## Nginx image
FROM scratch as nginx
COPY --from=nginx-stage /stage /
COPY data/nginx /etc/nginx
LABEL uk.org.kodo.maintainer "Dom Sekotill <dom.sekotill@kodo.org.uk>"
STOPSIGNAL SIGTERM
EXPOSE 80
CMD ["/usr/sbin/nginx", "-g", "daemon off;"]


ARG php_version=