The production backend Dockerfile was looking for Gradle files in a backend/ subdirectory that doesn't exist in the repo structure: - gradlew lives at repo root, not backend/gradlew - gradle/ wrapper dir lives at repo root, not backend/gradle/ - settings.gradle lives at repo root, not backend/settings.gradle Fixed by copying root-level Gradle files and placing backend-specific files in the backend/ subdirectory. Also added :backend: subproject prefix to Gradle tasks and corrected the output JAR path. This fixes the deploy pipeline failure: failed to calculate checksum: /backend/settings.gradle: not found
17 lines
531 B
Docker
17 lines
531 B
Docker
FROM eclipse-temurin:21-jdk AS builder
|
|
WORKDIR /app
|
|
COPY gradlew ./
|
|
COPY gradle/ ./gradle/
|
|
COPY settings.gradle ./
|
|
COPY backend/build.gradle backend/
|
|
RUN chmod +x gradlew && ./gradlew :backend:dependencies --no-daemon -q
|
|
COPY backend/src backend/src
|
|
RUN ./gradlew :backend:bootJar --no-daemon -q
|
|
|
|
FROM eclipse-temurin:21-jre-alpine
|
|
RUN addgroup -S bilhej && adduser -S bilhej -G bilhej
|
|
WORKDIR /app
|
|
COPY --from=builder /app/backend/build/libs/*-SNAPSHOT.jar ./app.jar
|
|
USER bilhej
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["java", "-jar", "app.jar"]
|