Commit 2a8b750a authored by daidekun's avatar daidekun

openresty

parent 41fe07f1
FROM 192.168.4.36/baseimg/centos FROM 192.168.4.36/baseimg/centos
MAINTAINER kalvin.dai <dekun.dai@quantgroup.cn> MAINTAINER kalvin.dai <dekun.dai@quantgroup.cn>
ENV LUA_VERSION 5.3.4 ARG RESTY_LUAROCKS_VERSION="2.4.3"
RUN echo $'[nginx]\n\ ARG RESTY_RPM_FLAVOR=""
name=nginx repo\n\ ARG RESTY_RPM_VERSION="1.13.6.1-1.el7.centos"
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/\n\ ARG RESTY_RPM_ARCH="x86_64"
gpgcheck=0\n\
enabled=1\n\
' | tee /etc/yum.repos.d/nginx.repo;\
echo $'[openresty]\n\
name=Official OpenResty Repository\n\
baseurl=https://copr-be.cloud.fedoraproject.org/results/openresty/openresty/epel-$releasever-$basearch/\n\
skip_if_unavailable=True\n\
gpgcheck=1\n\
gpgkey=https://copr-be.cloud.fedoraproject.org/results/openresty/openresty/pubkey.gpg\n\
enabled=1\n\
enabled_metadata=1\n\
' | tee /etc/yum.repos.d/openresty.repo;\
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
# Install OpenResty RUN yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo \
&& yum -y update && yum -y install make gcc readline-devel ;\ && yum install -y \
curl -L http://www.lua.org/ftp/lua-${LUA_VERSION}.tar.gz | tar xzf - && \ gettext \
cd /lua-${LUA_VERSION} && \ make \
make linux test && \ openresty${RESTY_RPM_FLAVOR}-${RESTY_RPM_VERSION}.${RESTY_RPM_ARCH} \
make install && \ openresty-opm-${RESTY_RPM_VERSION} \
cd .. && rm -rf /lua-${LUA_VERSION} &&\ openresty-resty-${RESTY_RPM_VERSION} \
yum install -y \ unzip \
nginx luajit luajit-fun inotify-tools openresty \ && cd /tmp \
openresty-{openssl,opm,pcre,resty,zlib,valgrind} \ && curl -fSL https://github.com/luarocks/luarocks/archive/${RESTY_LUAROCKS_VERSION}.tar.gz -o luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \
lua-{fun,json,lpeg,ldap,lunit,md5} source-highlight \ && tar xzf luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \
&& yum clean all && cd luarocks-${RESTY_LUAROCKS_VERSION} \
&& ./configure \
--prefix=/usr/local/openresty/luajit \
--with-lua=/usr/local/openresty/luajit \
--lua-suffix=jit-2.1.0-beta3 \
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 \
&& make build \
&& make install \
&& cd /tmp \
&& rm -rf luarocks-${RESTY_LUAROCKS_VERSION} luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \
&& yum remove -y make \
&& yum clean all \
&& ln -sf /dev/stdout /usr/local/openresty/nginx/logs/access.log \
&& ln -sf /dev/stderr /usr/local/openresty/nginx/logs/error.log
# Unused, present for parity with other Dockerfiles
# This makes some tooling/testing easier, as specifying a build-arg
# and not consuming it fails the build.
ARG RESTY_J="1"
# Add additional binaries into PATH for convenience
ENV PATH=$PATH:/usr/local/openresty/luajit/bin/:/usr/local/openresty/nginx/sbin/:/usr/local/openresty/bin/
# Copy nginx configuration files
COPY nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
COPY nginx.vh.default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80 443 3000 9001 EXPOSE 80 443 3000 9001
CMD ["openresty","-g","daemon off;"]
\ No newline at end of file CMD ["/usr/bin/openresty", "-g", "daemon off;"]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment