-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
143 lines (127 loc) · 4.76 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
FROM ubuntu:14.04
MAINTAINER Erik Osterman <[email protected]>
ENV NGINX_VERSION tengine-2.1.0
ENV DEBIAN_FRONTEND noninteractive
ENV LANGUAGE en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
# Configure timezone and locale
RUN locale-gen $LANGUAGE && \
dpkg-reconfigure locales
WORKDIR /usr/src/
ADD https://github.com/alibaba/tengine/archive/${NGINX_VERSION}.tar.gz tengine.tar.gz
# https://github.com/alibaba/tengine/blob/master/auto/options
# https://travis-ci.org/alibaba/tengine/jobs/32304924
RUN apt-get update && \
apt-get -y install libssl-dev \
libpcre3-dev \
zlib1g-dev \
libgeoip-dev \
libxslt1-dev \
libgd2-dev \
build-essential \
libc6 \
libexpat1 \
libgd2-xpm-dev \
libgeoip1 \
libgeoip-dev \
libpam0g \
libssl1.0.0 \
libxml2 \
libxslt1.1 \
zlib1g \
openssl \
liblua5.1-0-dev \
lua5.1 \
libgd2-xpm-dev \
libgeoip-dev \
libxslt1-dev \
libpcre++0 \
libpcre++-dev \
libperl-dev \
wget \
curl && \
tar -zxvf tengine.tar.gz && \
cd tengine-${NGINX_VERSION} && \
./configure \
--enable-mods-static=all \
--user=www-data \
--group=www-data \
--prefix=/usr/share/nginx \
--conf-path=/etc/nginx/nginx.conf \
--lock-path=/var/lock/nginx.lock \
--pid-path=/run/nginx.pid \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--with-http_ssl_module \
--with-http_gzip_static_module \
--with-http_gunzip_module \
--with-md5=/usr/include/openssl \
--with-sha1-asm \
--with-md5-asm \
--with-http_auth_request_module \
--with-http_image_filter_module \
--with-http_addition_module \
--with-http_dav_module \
--with-http_realip_module \
--with-http_spdy_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_sub_module \
--with-http_xslt_module \
--with-http_upstream_ip_hash_module=shared \
--with-http_upstream_least_conn_module=shared \
--with-http_upstream_session_sticky_module=shared \
--with-http_map_module=shared \
--with-http_user_agent_module=shared \
--with-http_mp4_module \
--with-http_split_clients_module=shared \
--with-http_access_module=shared \
--with-http_user_agent_module=shared \
--with-http_degradation_module \
--with-http_upstream_check_module \
--with-http_upstream_consistent_hash_module \
--with-ipv6 \
--with-file-aio \
--with-mail \
--with-mail_ssl_module \
--with-pcre \
--with-pcre-jit \
--prefix=/etc/nginx \
--with-debug \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log \
--sbin-path=/usr/sbin/nginx && \
make && \
make install && \
mkdir /var/cache/nginx && \
mkdir /var/ngx_pagespeed_cache && \
mkdir /var/log/pagespeed && \
mkdir /etc/nginx/conf.d && \
mkdir -p /etc/nginx/sites-available && \
mkdir -p /etc/nginx/sites-enabled && \
mkdir -p /var/lib/nginx/body && \
chown -R www-data:www-data /var/cache/nginx && \
chown -R www-data:www-data /var/ngx_pagespeed_cache && \
chown -R www-data:www-data /var/log/nginx && \
chown -R www-data:www-data /var/log/pagespeed && \
chown -R www-data:www-data /etc/nginx/sites-available && \
chown -R www-data:www-data /etc/nginx/sites-enabled && \
chown -R www-data:www-data /var/lib/nginx/body && \
apt-get -y remove build-essential && \
dpkg --get-selections | awk '{print $1}'|cut -d: -f1|grep -- '-dev$' | xargs apt-get remove -y && \
rm -rf /usr/src && \
apt-get clean all && \
rm -rf /tmp/* && \
ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log
ADD nginx.conf /etc/nginx/nginx.conf
ADD html/ /etc/nginx/html/
VOLUME ["/var/log/nginx"]
VOLUME ["/var/cache/nginx"]
WORKDIR /etc/nginx
EXPOSE 80 443
CMD ["nginx", "-g", "daemon off;"]