-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
72 lines (66 loc) · 2.27 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
FROM debian:jessie
LABEL version="1.11.2.2"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-utils \
ca-certificates \
curl \
build-essential \
git \
libgeoip-dev \
libpcre3-dev \
libreadline-dev \
libssl-dev \
make \
perl \
unzip \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
ENV OPENRESTY_VERSION 1.11.2.2
ENV OPENRESTY_PREFIX /opt/openresty
ENV NGINX_PREFIX /opt/openresty/nginx
ENV VAR_PREFIX /var/nginx
ENV LUAROCKS_VERSION 2.3.0
RUN curl -sSL http://openresty.org/download/openresty-${OPENRESTY_VERSION}.tar.gz | tar -xvz \
&& cd openresty-* \
&& readonly NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) \
&& ./configure \
--prefix=$OPENRESTY_PREFIX \
--http-client-body-temp-path=$VAR_PREFIX/client_body_temp \
--http-proxy-temp-path=$VAR_PREFIX/proxy_temp \
--http-log-path=$VAR_PREFIX/access.log \
--error-log-path=$VAR_PREFIX/error.log \
--pid-path=$VAR_PREFIX/nginx.pid \
--lock-path=$VAR_PREFIX/nginx.lock \
--with-http_auth_request_module \
--with-http_geoip_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-ipv6 \
--with-luajit \
--with-pcre-jit \
--without-http_fastcgi_module \
--without-http_uwsgi_module \
--without-http_userid_module \
--without-http_scgi_module \
--without-http_ssi_module \
-j${NPROC} \
&& make -j${NPROC} \
&& make install \
&& ln -sf $NGINX_PREFIX/sbin/nginx /usr/local/bin/nginx \
&& ln -sf $NGINX_PREFIX/sbin/nginx /usr/local/bin/openresty \
&& ln -sf $OPENRESTY_PREFIX/bin/resty /usr/local/bin/resty \
&& ln -sf $OPENRESTY_PREFIX/luajit/bin/luajit-* $OPENRESTY_PREFIX/luajit/bin/lua \
&& ln -sf $OPENRESTY_PREFIX/luajit/bin/luajit-* /usr/local/bin/lua \
&& rm -rf /root/openresty*
RUN curl -sSL http://keplerproject.github.io/luarocks/releases/luarocks-${LUAROCKS_VERSION}.tar.gz | tar -xvz -C /root/ \
&& cd /root/luarocks-* \
&& ./configure \
--with-lua=$OPENRESTY_PREFIX/luajit/ \
--with-lua-include=$OPENRESTY_PREFIX/luajit/include/luajit-2.1 \
--with-lua-lib=$OPENRESTY_PREFIX/lualib \
&& make build \
&& make install \
&& rm -rf /root/luarocks*
WORKDIR $NGINX_PREFIX/
CMD ["nginx", "-g", "daemon off; error_log /dev/stderr info;"]