2019-08-08 14:45:52 +00:00
|
|
|
# Build as build stage named "maven"
|
|
|
|
|
FROM maven:3-jdk-8 as maven
|
|
|
|
|
WORKDIR /usr/src
|
|
|
|
|
COPY pom.xml .
|
|
|
|
|
COPY src src
|
2020-11-26 12:22:47 +00:00
|
|
|
# Copy default props file
|
2019-08-08 14:45:52 +00:00
|
|
|
COPY src/main/resources/props/sample.props.template src/main/resources/props/default.props
|
2020-11-26 12:19:26 +00:00
|
|
|
COPY src/main/resources/container.logback.xml.example src/main/resources/default.logback.xml
|
2022-09-22 19:28:57 +00:00
|
|
|
RUN --mount=type=cache,target=/root/.m2 mvn -e -B dependency:resolve
|
|
|
|
|
RUN --mount=type=cache,target=/root/.m2 mvn -e -B package
|
2019-08-08 14:45:52 +00:00
|
|
|
|
2020-11-26 12:19:26 +00:00
|
|
|
FROM jetty
|
2019-08-08 14:45:52 +00:00
|
|
|
|
|
|
|
|
# Copy source from maven build stage
|
2020-11-26 12:19:26 +00:00
|
|
|
COPY --from=maven /usr/src/target/API_Explorer-1.0.war /var/lib/jetty/webapps/root.war
|
2019-08-08 14:45:52 +00:00
|
|
|
|
|
|
|
|
EXPOSE 8080
|