initial commit
All checks were successful
Build and Push to ACR / Build and Push (push) Successful in 1m34s
All checks were successful
Build and Push to ACR / Build and Push (push) Successful in 1m34s
Change-Id: I11e12d8d4c914eabdc30ba4d8be494fd09b617a3
This commit is contained in:
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
# ---- 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"]
|
||||
Reference in New Issue
Block a user