forked from eclipse-tractusx/item-relationship-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (29 loc) · 990 Bytes
/
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
41
42
# Dependencies
FROM maven:3-openjdk-17-slim AS maven
ARG BUILD_TARGET=irs-api
WORKDIR /build
COPY ci ci
COPY api api
COPY .mvn .mvn
COPY pom.xml .
COPY integration-tests integration-tests
COPY irs-api irs-api
COPY irs-models irs-models
COPY irs-parent-spring-boot irs-parent-spring-boot
COPY irs-testing irs-testing
COPY irs-report-aggregate irs-report-aggregate
COPY cucumber-tests cucumber-tests
COPY docs docs
# the --mount option requires BuildKit.
RUN --mount=type=cache,target=/root/.m2 mvn -B clean package -pl :$BUILD_TARGET -am -DskipTests
# Copy the jar and build image
FROM eclipse-temurin:19-jre-alpine AS irs-api
RUN apk upgrade
ARG UID=10000
ARG GID=1000
WORKDIR /app
COPY --chmod=755 --from=maven /build/irs-api/target/irs-api-*-exec.jar app.jar
USER ${UID}:${GID}
ENTRYPOINT ["java", "-Djava.util.logging.config.file=./logging.properties", "-jar", "app.jar"]
HEALTHCHECK --interval=5m --timeout=3s \
CMD curl -f http://localhost:4004/actuator/health || exit 1