-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
56 lines (44 loc) · 1.51 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
FROM debian:jessie
MAINTAINER Dylan Wang "[email protected]"
ENV NGINX_VERSION 1.9.6
RUN apt-get update && apt-get install -y ca-certificates build-essential wget libpcre3 libpcre3-dev zlib1g zlib1g-dev libssl-dev
RUN wget http://www.openssl.org/source/openssl-1.0.2d.tar.gz \
&& tar -xvzf openssl-1.0.2d.tar.gz \
&& cd openssl-1.0.2d \
&& ./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;"]