forked from citipo/docker-google-fonts-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (36 loc) · 1.32 KB
/
Copy pathDockerfile
File metadata and controls
46 lines (36 loc) · 1.32 KB
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
FROM nginx:1.21-alpine AS builder
ENV SUBS_VERSION 1.1.15
ENV FONTS_HOST 'http://localhost'
RUN apk add --no-cache --virtual .build-deps \
git \
gcc \
libc-dev \
make \
openssl-dev \
pcre2-dev \
zlib-dev \
linux-headers \
libxslt-dev \
gd-dev \
geoip-dev \
perl-dev \
libedit-dev \
bash \
alpine-sdk \
findutils
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz
RUN mkdir /tmp/src && CONFARGS=$(nginx -V 2>&1 | sed -n -e 's/^.*arguments: //p') tar -zxC /tmp/src -f nginx.tar.gz
RUN git clone git://github.com/yaoweibin/ngx_http_substitutions_filter_module.git
RUN SUBSDIR="$(pwd)/ngx_http_substitutions_filter_module" && \
cd /tmp/src/nginx-$NGINX_VERSION && \
./configure --with-compat $CONFARGS --add-dynamic-module=$SUBSDIR && \
make && \
make install
FROM nginx:1.21-alpine
# Extract the dynamic module NCHAN from the builder image
COPY --from=builder /usr/local/nginx/modules/ngx_http_subs_filter_module.so /usr/local/nginx/modules/ngx_http_subs_filter_module.so
COPY ./conf/nginx.conf.template /etc/nginx/nginx.conf.template
COPY ./docker-entrypoint.sh /
RUN chmod a+x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]