# https://hub.docker.com/orgs/seataio
# mvn  clean install -DskipTests=true -P release-seata
FROM centos:7


# set label
LABEL maintainer="Seata <seata.io>"

WORKDIR /$BASE_DIR

# ADD FORM distribution
ADD bin/ /seata-server/bin
ADD lib/ /seata-server/lib
ADD conf/ /seata-server/conf
ADD target/ /seata-server/target
ADD LICENSE /seata-server/LICENSE
RUN chmod 755 /seata-server/bin/seata-server.sh


# set extra environment
ENV LOADER_PATH="/seata-server/lib"
ENV TZ="Asia/Shanghai"
ENV EXTRA_JVM_ARGUMENTS="-Djava.security.egd=file:/dev/./urandom -server -Xss512k -XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport XX:SurvivorRatio=10 -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -XX:MaxDirectMemorySize=1024m -XX:-OmitStackTraceInFastThrow -XX:-UseAdaptiveSizePolicy -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=75 -Xloggc:/var/log/seata_gc.log -verbose:gc -Dio.netty.leakDetectionLevel=advanced"

CMD ["sh","-c","/seata-server/bin/seata-server.sh && tail -f /dev/null"]
#CMD ["sh","/seata-server/bin/seata-server.sh"]
