@@ -5,8 +5,9 @@ LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>"
55ENV NGINX_VERSION 1.15.12
66
77RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
8+ # Nginx Build Config
89 && CONFIG="\
9- --add-module=.. /ngx_brotli \
10+ --add-module=/usr/src /ngx_brotli \
1011 --prefix=/etc/nginx \
1112 --sbin-path=/usr/sbin/nginx \
1213 --modules-path=/usr/lib/nginx/modules \
@@ -51,8 +52,10 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
5152 --with-file-aio \
5253 --with-http_v2_module \
5354 " \
55+ # Nginx will be run under user nginx:nginx
5456 && addgroup -S nginx \
5557 && adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \
58+ # Installing build dependencies
5659 && apk add --no-cache --virtual .build-deps \
5760 gcc \
5861 libc-dev \
@@ -67,6 +70,9 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
6770 gd-dev \
6871 geoip-dev \
6972 git \
73+ && mkdir -p /usr/src \
74+ && cd /usr/src \
75+ && echo "Downloading Nginx" \
7076 && curl -fSL https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \
7177 && curl -fSL https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \
7278 # Verifying Nginx
@@ -84,14 +90,14 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
8490 test -z "$found" && echo >&2 "error: failed to fetch GPG key $GPG_KEYS" && exit 1; \
8591 gpg --batch --verify nginx.tar.gz.asc nginx.tar.gz \
8692 && rm -rf "$GNUPGHOME" nginx.tar.gz.asc \
87- && mkdir -p /usr/src \
8893 && tar -zxC /usr/src -f nginx.tar.gz \
8994 && rm -f nginx.tar.gz \
9095 # Downloading Brotli
96+ && echo "Downloading Brotli" \
9197 && cd /usr/src \
92- && git clone https://github.com/google/ngx_brotli.git \
93- && cd ngx_brotli \
94- && git submodule update --init \
98+ && git clone --recursive https://github.com/google/ngx_brotli.git \
99+ # Building Nginx
100+ && echo "Building Nginx" \
95101 && cd /usr/src/nginx-$NGINX_VERSION \
96102 && ./configure $CONFIG --with-debug \
97103 && make -j$(getconf _NPROCESSORS_ONLN) \
@@ -148,8 +154,8 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
148154COPY nginx.conf /etc/nginx/nginx.conf
149155COPY nginx.vh.default.conf /etc/nginx/conf.d/default.conf
150156
151- EXPOSE 80
157+ EXPOSE 80 443
152158
153159STOPSIGNAL SIGTERM
154160
155- CMD ["nginx" , "-g" , "daemon off;" ]
161+ CMD ["nginx" , "-g" , "daemon off;" ]
0 commit comments