-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
118 lines (104 loc) · 3.09 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
FROM ubuntu:14.04
MAINTAINER Synctree Appforce
RUN apt-get update \
&& apt-get install -y \
git \
wget \
curl \
gnupg \
unzip \
libgd-dev \
supervisor \
libxslt-dev \
libperl-dev \
libgeoip-dev \
libldap2-dev \
build-essential \
&& apt-get clean
RUN mkdir -p /usr/proxy/configs /usr/proxy/dependencies /usr/proxy/ldap-auth-module
WORKDIR /usr/proxy
# NGINX dependencies:
# PCRE
# zlib
# openssl
# PCRE
RUN cd /usr/proxy/dependencies \
&& wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz \
&& tar -zxf pcre-8.39.tar.gz \
&& cd pcre-8.39 \
&& ./configure \
&& make \
&& make install
# zlib
RUN cd /usr/proxy/dependencies \
&& wget http://zlib.net/zlib-1.2.11.tar.gz \
&& tar -zxf zlib-1.2.11.tar.gz \
&& cd zlib-1.2.11 \
&& ./configure \
&& make \
&& make install
# openssl
RUN cd /usr/proxy/dependencies \
&& wget http://www.openssl.org/source/openssl-1.0.2j.tar.gz \
&& tar -zxf openssl-1.0.2j.tar.gz \
&& cd openssl-1.0.2j \
&& ./config --prefix=/usr \
&& make \
&& make install
# nginx-auth-ldap
RUN cd /usr/proxy/dependencies \
&& wget https://github.com/kvspb/nginx-auth-ldap/archive/master.zip -O nginx-auth-ldap.zip \
&& unzip nginx-auth-ldap.zip \
&& mv nginx-auth-ldap-master nginx-auth-ldap
# NGINX stable
RUN cd /usr/proxy/dependencies \
&& wget http://nginx.org/download/nginx-1.10.2.tar.gz \
&& tar zxf nginx-1.10.2.tar.gz \
&& cd nginx-1.10.2 \
&& ./configure \
--sbin-path=/usr/local/nginx/nginx \
--conf-path=/usr/local/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--with-pcre=../pcre-8.39 \
--with-zlib=../zlib-1.2.11 \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_stub_status_module \
--with-http_auth_request_module \
--with-http_xslt_module=dynamic \
--with-http_image_filter_module=dynamic \
--with-http_geoip_module=dynamic \
--with-http_perl_module=dynamic \
--with-threads \
--with-stream \
--with-stream_ssl_module \
--with-http_slice_module \
--with-mail \
--with-mail_ssl_module \
--with-file-aio \
--with-http_v2_module \
--with-ipv6 \
--add-module=/usr/proxy/dependencies/nginx-auth-ldap \
&& make \
&& make install
RUN mkdir -p /usr/local/nginx/conf.d /var/cache/nginx/client_temp /var/cache/nginx/proxy_temp
ADD configs /usr/proxy/configs/
RUN mv /usr/local/nginx/nginx.conf /usr/local/nginx/nginx.conf.ORIG
ADD docker/etc/nginx/nginx.conf /usr/local/nginx/nginx.conf
ADD docker/usr/bin/* /usr/bin/
ADD docker/docker-entrypoint.sh /docker-entrypoint.sh
EXPOSE 80
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD [ "bash" ]