forked from Ehekatl/docker-nginx-http2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
61 lines (46 loc) · 1.66 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
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM debian:jessie
MAINTAINER Dylan Wang "[email protected]"
# ARG not working with automated Docker Hub builds
RUN apt-get update && apt-get install -y ca-certificates build-essential wget libpcre3 libpcre3-dev zlib1g zlib1g-dev libssl-dev
ENV OPENSSL_VERSION ${OPENSSL_VERSION:-1.1.0e}
ENV NGINX_VERSION ${NGINX_VERSION:-1.13.0}
RUN wget http://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
&& tar -xvzf openssl-${OPENSSL_VERSION}.tar.gz \
&& cd openssl-${OPENSSL_VERSION} \
&& ./config \
--prefix=/usr \
--openssldir=/usr/ssl \
&& make && make install \
&& ./config shared \
--prefix=/usr/local \
--openssldir=/usr/local/ssl \
&& make clean \
&& make && make install
RUN wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz \
&& tar -xzvf nginx-${NGINX_VERSION}.tar.gz
COPY conf /nginx-${NGINX_VERSION}/auto/lib/openssl/
RUN cd nginx-${NGINX_VERSION} \
&& ./configure \
--prefix=/usr/local/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_ssl_module \
--with-http_v2_module \
--with-openssl=/usr \
--with-http_realip_module \
--with-http_stub_status_module \
--with-threads \
--with-ipv6 \
&& make \
&& make install
RUN apt-get purge build-essential -y \
&& apt-get autoremove -y
# forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log
RUN ln -sf /dev/stderr /var/log/nginx/error.log
VOLUME ["/var/cache/nginx"]
EXPOSE 80 443
CMD ["nginx", "-g", "daemon off;"]