Перенос из 3 лабы

This commit is contained in:
Dmitry
2026-11-09 21:34:03 +03:00
parent ec540a1a72
commit 034d5537cf
77 changed files with 3253 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
FROM eclipse-temurin:22-jdk-alpine AS builder
WORKDIR /app
RUN apk add --no-cache dos2unix
COPY gradlew .
COPY gradle gradle
COPY build.gradle.* settings.gradle* build.gradle.kts* settings.gradle.kts* ./
RUN dos2unix gradlew && chmod +x gradlew
RUN ./gradlew dependencies --no-daemon || true
COPY src src
RUN apk add --no-cache curl
RUN ./gradlew bootJar -x test --no-daemon
FROM eclipse-temurin:22-jre-alpine AS runtime
WORKDIR /app
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
COPY --from=builder /app/build/libs/*.jar app.jar
RUN chown -R appuser:appgroup /app
USER appuser
EXPOSE 8080
HEALTHCHECK --interval=10s --timeout=3s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/actuator/health || exit 1
ENTRYPOINT ["java", "-jar", "app.jar"]