FROM ubuntu:18.04

ENV TZ=Asia/Shanghai

RUN apt-get update \
          && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
          && apt-get clean \
          && apt-get autoclean \
          && apt-get install tzdata \
          && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
          
ADD https://github.com/golang/go/raw/master/lib/time/zoneinfo.zip /zoneinfo.zip
ENV ZONEINFO /zoneinfo.zip

RUN mkdir -p /opt/qznn
RUN mkdir -p /opt/qznn/conf
RUN mkdir -p /opt/qznn/logs

COPY version.txt /opt/qznn/version.txt
COPY ./dist/qznn /opt/qznn/qznn
COPY ./conf/* /opt/qznn/conf/

RUN chmod +x /opt/qznn/qznn

COPY ./assets/cacert.pem /etc/ssl/certs/


WORKDIR /opt/qznn
EXPOSE 18878
CMD ["./qznn"]

