-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.api
More file actions
27 lines (26 loc) · 1016 Bytes
/
Copy pathDockerfile.api
File metadata and controls
27 lines (26 loc) · 1016 Bytes
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
# Stage 1: Build
FROM maven:3.9-eclipse-temurin-17 AS build
WORKDIR /app
COPY pom.xml .
COPY notify-core/pom.xml notify-core/
COPY notify-channels/ notify-channels/
COPY notify-tracker-jpa/pom.xml notify-tracker-jpa/
COPY notify-audit-jpa/pom.xml notify-audit-jpa/
COPY notify-queue-rabbitmq/pom.xml notify-queue-rabbitmq/
COPY notify-queue-kafka/pom.xml notify-queue-kafka/
COPY notify-spring-boot-starter/pom.xml notify-spring-boot-starter/
COPY notify-admin/pom.xml notify-admin/
COPY notify-demo/pom.xml notify-demo/
COPY notify-mcp/pom.xml notify-mcp/
RUN mvn dependency:go-offline -pl notify-demo -am -B 2>/dev/null || true
COPY . .
RUN mvn clean package -pl notify-demo -am -DskipTests -B -q
# Stage 2: Runtime
FROM eclipse-temurin:17-jre-alpine
RUN addgroup -S notifyhub && adduser -S notifyhub -G notifyhub
USER notifyhub
WORKDIR /app
COPY --from=build /app/notify-demo/target/notify-demo-*.jar notifyhub-api.jar
EXPOSE 8080
ENV SPRING_PROFILES_ACTIVE=real
ENTRYPOINT ["java", "-jar", "notifyhub-api.jar"]