FROM registry.sdsys.ru/build-image:alpine-3.10-2 as build ARG git_repo=git@github.com:icruportal/web-registration.git ARG branch=release ARG gradle_version=5.2.1 COPY id_rsa /root/.ssh RUN export GRADLE_HOME=/opt/gradle/gradle-${gradle_version} \ && export PATH=${GRADLE_HOME}/bin:${PATH} \ && gradle -v \ && printf "Host github.com \n\tStrictHostKeyChecking no" > /root/.ssh/config \ && git clone ${git_repo} \ && cd web-registration && git checkout ${branch} \ && echo $(git log -p -1 --pretty=format:"%h"|head -n1) > /tmp/version \ && cd customer-api && mvn clean install \ && figlet -c Building Public \ && cd ../promo/src/public && npm install && npm start \ && figlet -c Building Promo \ && cd ../../ && gradle tasks bootWar \ && rm -rf /root/.ssh/id_rsa FROM registry.sdsys.ru/iru/iru-base:7.6 ARG DB_CLUSTER=mongodb1:27017,mongodb2:27018,mongodb3:27019 ARG SERVER_PORT=9000 HEALTHCHECK --start-period=40s --interval=15s --timeout=5s --retries=2 CMD curl -f 127.0.0.1:${SERVER_PORT} || exit 1 COPY --from=build /web-registration/promo/build/libs/promo-0.0.1-SNAPSHOT.war /opt/ COPY --from=build /tmp/version /tmp/ CMD ["java", "-jar", "/opt/promo-0.0.1-SNAPSHOT.war"]