all for lab2

This commit is contained in:
2026-10-13 15:27:39 +03:00
parent 65003b6119
commit 983ee548e0
68 changed files with 4760 additions and 24 deletions
+26
View File
@@ -0,0 +1,26 @@
FROM maven:3.9.9-eclipse-temurin-21 AS builder
WORKDIR /build
COPY java/pom.xml .
RUN mvn -B -q dependency:go-offline
COPY java/src ./src
RUN mvn -B -q clean package -DskipTests
FROM eclipse-temurin:21-jre-alpine AS runtime
RUN addgroup -g 1001 -S appgroup \
&& adduser -u 1001 -S appuser -G appgroup
WORKDIR /app
COPY --from=builder /build/target/*.jar app.jar
RUN chown -R appuser:appgroup /app
USER appuser
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
CMD wget -qO- http://localhost:8080/health/live || exit 1
ENTRYPOINT ["java", "-XX:MaxRAMPercentage=75.0", "-jar", "/app/app.jar"]