Files
khalil-bot 1621465e95 feat(notification-service): add Dockerfile, actuator health and alert deduplication
Add multi-stage Dockerfile with eclipse-temurin:17 and HEALTHCHECK on /actuator/health.
Expose /actuator/health endpoint via spring-boot-starter-actuator.
Deduplicate alerts: only notify when a room's CO2 level changes, reset on recovery.

Assisted-by: Claude:claude-sonnet-4-6
2026-06-01 12:37:35 +02:00

21 lines
845 B
Docker

# ── Stage 1 : build ──────────────────────────────────────────────────────────
FROM eclipse-temurin:17-jdk-alpine AS builder
WORKDIR /app
COPY pom.xml .
COPY src ./src
RUN apk add --no-cache maven && mvn package -DskipTests -q
# ── Stage 2 : run ─────────────────────────────────────────────────────────────
FROM eclipse-temurin:17-jre-alpine
WORKDIR /app
COPY --from=builder /app/target/notification-service-*.jar app.jar
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD wget -qO- http://localhost:8080/actuator/health || exit 1
ENTRYPOINT ["java", "-jar", "app.jar"]