-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (27 loc) · 1.33 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM --platform=$BUILDPLATFORM maven:3-eclipse-temurin-8 as builder
WORKDIR /sources
COPY ./ /sources
# store maven dependencies so next build doesn't have to download them again
RUN --mount=type=cache,target=/root/.m2/repository \
mvn -B dependency:go-offline
RUN --mount=type=cache,target=/root/.m2/repository \
mvn -B package -DskipTests
RUN mkdir /application && \
cp target/*.jar /application/csw-ingester.jar
WORKDIR /application
# Extract spring boot JAR layers
RUN --mount=type=cache,target=/root/.m2/repository \
java -Djarmode=layertools -jar csw-ingester.jar extract
FROM eclipse-temurin:8-jre as finalImage
LABEL vendor="GeoCat B.V."
LABEL org.opencontainers.image.source https://github.com/GeoCat/csw-ingester
# Check the file application.properties for a description of the environment variables that can be customized.
# The property names can be translated to environment varibles passing them to upper case and replacing the dots
# with underscores. For example harvester.jdbc.url -> HARVESTER_JDBC_URL
WORKDIR /opt/jrc-ingester
COPY --from=builder /application/dependencies/ ./
COPY --from=builder /application/spring-boot-loader ./
COPY --from=builder /application/snapshot-dependencies/ ./
COPY --from=builder /application/application/ ./
EXPOSE 9999
CMD [ "java", "org.springframework.boot.loader.JarLauncher" ]