prod107ac/sureops/prod107ac-back-b/deployment/Dockerfile

33 lines
872 B
Docker
Executable File

#pulling from github
FROM alpine/git:v2.30.1 AS code
ARG BUILD_ID
ARG GITEA_USER
ARG GITEA_PASS
RUN echo $BUILD_ID
LABEL stage=builder
LABEL build_id=$BUILD_ID
RUN mkdir repo
WORKDIR /repo
RUN git clone http://$GITEA_USER:$GITEA_PASS@git.io8.dev/risadmin_prod/prod107ac.git
#************* Stage 2 - Maven Build **************
FROM maven:3.9.3 AS mvn
LABEL stage=builder
LABEL build=$BUILD_ID
WORKDIR /workspace/app
COPY --from=code /repo/prod107ac/prod107ac-back-b/authsec_springboot/backend/ /workspace/app
RUN mkdir builder/
RUN mvn install -Dmaven.test.skip
#******** Stage 3 - Docker Build *********
#FROM java:8-jdk-alpine
FROM openjdk:8-jdk-alpine
LABEL stage=app
LABEL build=$BUILD_ID
RUN mkdir /usr/app
COPY --from=mvn /workspace/app/target/*jar /usr/app/gtest.jar
RUN mkdir /usr/app/sureops
WORKDIR /usr/app
EXPOSE 9292
ENTRYPOINT ["java", "-jar", "gtest.jar"]