This repository has been archived by the owner on Aug 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (41 loc) · 1.89 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
ARG version=1.25.1
FROM nginx:mainline-alpine-slim AS builder
ARG version
ARG pam=1.5.3
ARG fancyindex=0.5.2
WORKDIR /root/
# base nginx
RUN apk add --update --no-cache build-base pcre2-dev zlib-dev linux-pam-dev brotli-dev \
&& wget http://nginx.org/download/nginx-${version}.tar.gz \
&& tar zxf nginx-${version}.tar.gz \
# auth-pam module
&& wget https://github.com/sto/ngx_http_auth_pam_module/archive/refs/tags/v${pam}.tar.gz -O ngx_auth.tar.gz \
&& tar xf ngx_auth.tar.gz \
&& cd ngx_http_auth_pam_module-${pam} \
&& cd ../nginx-${version} \
&& ./configure --with-compat --add-dynamic-module=../ngx_http_auth_pam_module-${pam} \
&& make modules \
# brotli module
&& cd /root/ \
&& wget https://github.com/google/ngx_brotli/archive/refs/tags/v1.0.0rc.tar.gz -O ngx_brotli.tar.gz \
&& tar xf ngx_brotli.tar.gz \
&& cd ngx_brotli-1.0.0rc \
&& cd ../nginx-${version} \
&& ./configure --with-compat --add-dynamic-module=../ngx_brotli-1.0.0rc \
&& make modules \
# fancyindex module
&& cd /root/ \
&& wget https://github.com/aperezdc/ngx-fancyindex/archive/refs/tags/v${fancyindex}.tar.gz -O ngx_fancyindex.tar.gz \
&& tar xf ngx_fancyindex.tar.gz \
&& cd ngx-fancyindex-${fancyindex} \
&& cd ../nginx-${version} \
&& ./configure --with-compat --add-dynamic-module=../ngx-fancyindex-${fancyindex} \
&& make modules
FROM nginx:mainline-alpine-slim
ARG version
# copy all the modules
RUN apk add --update --no-cache brotli-libs
COPY --from=builder /root/nginx-${version}/objs/ngx_http_auth_pam_module.so /usr/lib/nginx/modules/
COPY --from=builder /root/nginx-${version}/objs/ngx_http_brotli_filter_module.so /usr/lib/nginx/modules/
COPY --from=builder /root/nginx-${version}/objs/ngx_http_brotli_static_module.so /usr/lib/nginx/modules/
COPY --from=builder /root/nginx-${version}/objs/ngx_http_fancyindex_module.so /usr/lib/nginx/modules/