-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfileApp
29 lines (23 loc) · 976 Bytes
/
DockerfileApp
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
FROM node:22.13.0 AS frontend
WORKDIR /frontend
COPY frontend .
RUN npm ci
RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN \
SENTRY_AUTH_TOKEN=$(cat /run/secrets/SENTRY_AUTH_TOKEN) \
npm run build
FROM gradle:8.12-jdk21 AS backend
COPY backend /backend
COPY LegalDocML.de /LegalDocML.de
WORKDIR /backend
RUN mkdir -p src/main/resources/static
COPY --from=frontend /frontend/dist src/main/resources/static
RUN --mount=type=secret,id=SENTRY_DNS \
--mount=type=secret,id=SENTRY_AUTH_TOKEN \
SENTRY_DNS=$(cat /run/secrets/SENTRY_DNS) \
SENTRY_AUTH_TOKEN=$(cat /run/secrets/SENTRY_AUTH_TOKEN) \
./gradlew build --profile -x integrationTest -x test -x spotlessCheck
FROM cgr.dev/chainguard/jre:latest
COPY --from=backend /backend/build/libs/ris-norms-backend-*.jar /app/app.jar
ENV spring.cloud.bootstrap.enabled=true
EXPOSE 8080
ENTRYPOINT ["java","-XX:+HeapDumpOnOutOfMemoryError","-XX:HeapDumpPath=/etc/heap-dumps/heap-dump.bin","-jar","/app/app.jar"]