All checks were successful
Build and Push to ACR / Build and Push (push) Successful in 1m34s
Change-Id: I11e12d8d4c914eabdc30ba4d8be494fd09b617a3
27 lines
623 B
Docker
27 lines
623 B
Docker
# ---- Build stage ----
|
|
FROM maven:3.9-eclipse-temurin-17-alpine AS build
|
|
WORKDIR /workspace
|
|
|
|
COPY pom.xml .
|
|
RUN mvn dependency:go-offline -q
|
|
|
|
COPY src ./src
|
|
RUN mvn package -DskipTests -q
|
|
|
|
# ---- Runtime stage ----
|
|
FROM eclipse-temurin:17-jre-alpine
|
|
WORKDIR /app
|
|
|
|
# Non-root user
|
|
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
|
USER appuser
|
|
|
|
COPY --from=build /workspace/target/*.jar app.jar
|
|
|
|
EXPOSE 8080
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
|
|
CMD wget -qO- http://localhost:8080/actuator/health | grep -q '"status":"UP"' || exit 1
|
|
|
|
ENTRYPOINT ["java", "-jar", "app.jar"]
|