FROM openjdk:8-jre

ENV SERVER_PORT=8888
ENV SPRING_PROFILE_ACTIVE="dev"
ENV APP_HOME="/shandan"
ENV APP_NAME="shandan-oauth"
ENV APP_VERSION="1.0.0"

VOLUME /logs/

ADD target/shandan-oauth-1.0.0.jar ${APP_HOME}/shandan-oauth.jar
ADD target/classes/application.yml ${APP_HOME}/application.yml
ADD target/classes/application-dev.yml ${APP_HOME}/application-dev.yml
ADD target/classes/application-prod.yml ${APP_HOME}/application-prod.yml

EXPOSE $SERVER_PORT
ENTRYPOINT ["java","-jar","/shandan/shandan-oauth.jar","--server.port=${SERVER_PORT}", "--spring.profiles.active=${SPRING_PROFILE_ACTIVE}"]
