Dockerfile 1.2 KB

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