FROM 192.168.4.36/baseimg/openresty:201803291115

USER root
WORKDIR /home/quant_group

RUN mkdir -p /usr/local/openresty/nginx/conf/conf.d/;mkdir -p /usr/local/openresty/nginx/lua
ENV NODE_ENV=test

ARG BUILD_NUMBER 
ARG SYSTEM_NAME  
ARG BRANCH_NAME
ARG BUILD_TIME

ENV BUILD_NUMBER=$BUILD_NUMBER
ENV SYSTEM_NAME=$SYSTEM_NAME
ENV BRANCH_NAME=$BRANCH_NAME
ENV BUILD_TIME=$BUILD_TIME

RUN echo "BUILD_TIME: ${BUILD_TIME} ,BUILD_NUMBER: ${BUILD_NUMBER},SYSTEM_NAME: ${SYSTEM_NAME},BRANCH_NAME: ${BRANCH_NAME}" >> ./build_info

COPY nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
COPY *.vh.conf /usr/local/openresty/nginx/conf/conf.d/
COPY *.lua /usr/local/openresty/nginx/lua/

COPY docker-entrypoint.sh .
COPY *tgz ./

RUN chmod +x ./docker-entrypoint.sh
CMD ./docker-entrypoint.sh