FROM centos:7
COPY ./start.sh /root/
COPY ./openresty-1.15.8.1 /root/openresty-1.15.8.1
COPY ./conf /root/conf
RUN yum install -y perl perl-devel perl-ExtUtils-Embed pcre-devel openssl openssl-devel gcc readline-devel GeoIP-devel libreadline-dev libncurses5-dev libpcre3-dev libssl-dev libxml2 libxml2-devel libxslt libxslt-devel wget make
RUN cd /root/openresty-1.15.8.1 && chmod +x ./configure && ./configure --prefix=/usr/local/openresty --add-module=./bundle/ngx-uploasd-progress-module --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_geoip_module --with-http_realip_module --with-threads --with-pcre --with-file-aio --with-http_flv_module --with-http_mp4_module --with-luajit \
&& gmake && gmake install
ENV PATH $PATH:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin/
RUN mkdir -p /var/cache/nginx/microcache \
&& mv /usr/local/openresty/nginx/conf /usr/local/openresty/nginx/conf.back \
&& mv /root/conf /usr/local/openresty/nginx/conf
RUN chmod +x /root/start.sh
ENTRYPOINT ["sh","/root/start.sh"]
EXPOSE 80 443