oeffisearch/docker/Dockerfile.nginx
2020-02-07 23:33:29 +01:00

48 lines
1.2 KiB
Nginx Configuration File

FROM alpine:latest as build
ARG UID=1000
ARG GID=1000
ARG NGINX_VER=1.17.6
ARG NGINX_CONF="--prefix=/app --with-cc-opt='-static' \
--with-ld-opt='-static' --with-cpu-opt=generic --with-pcre \
--sbin-path=/app/nginx \
--http-log-path=/app/log/access.log \
--error-log-path=/app/log/error.log \
--pid-path=/app/nginx.pid \
--lock-path=/app/nginx.lock \
--without-http_gzip_module \
--without-http_uwsgi_module \
--without-http_scgi_module \
--without-http_fastcgi_module \
--without-http_memcached_module \
--without-http_empty_gif_module \
--without-http_geo_module \
--with-threads"
WORKDIR /tmp
RUN apk --update upgrade && \
apk add --no-cache --no-progress build-base pcre-dev wget && \
wget http://nginx.org/download/nginx-${NGINX_VER}.tar.gz && \
tar xzf nginx-${NGINX_VER}.tar.gz && \
cd /tmp/nginx-${NGINX_VER} && \
./configure ${NGINX_CONF} && \
make -j 1 && \
make install && \
mkdir /app/tmp && \
chown -R ${UID}:${GID} /app && \
chmod 7777 /app/tmp
FROM scratch
COPY --from=build /app /app
COPY ./docker/nginx.conf /app/nginx.conf
COPY ./client /app/www
EXPOSE 8080
ENTRYPOINT ["/app/nginx"]
CMD ["-c", "/app/nginx.conf"]