
FROM openjdk:8u212-jdk-alpine

MAINTAINER jianfeng.chen@northking.net

EXPOSE 6001

ENV CCTP_HOME /home/cctp

ENV JAR_FILE=atu-script-engine.jar
ENV TRACE_JAVAAGENT_OPTS='-javaagent:/home/cctp/trace-otel/hzb-otel-javaagent.jar -Dotel.javaagent.configuration-file=/home/cctp/trace-otel/trace-otel.properties'

VOLUME ${CCTP_HOME}

ADD engine ${CCTP_HOME}/

ADD target/dist ${CCTP_HOME}/

ENV TZ=Asia/Shanghai

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

WORKDIR ${CCTP_HOME}

RUN echo "java -jar -Xms512M -Xmx4096M -XX:+HeapDumpOnOutOfMemoryError -Dloader.path=.,lib -Dspring.profiles.active=test-linux ${JAR_FILE}" > /run.sh && chmod 777 /run.sh

ENTRYPOINT ["/bin/sh", "/run.sh"]