fix: correct COPY paths in backend.prod.Dockerfile
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
This commit is contained in:
parent
7938a1620b
commit
5eb49c05a8
1 changed files with 8 additions and 7 deletions
|
|
@ -1,16 +1,17 @@
|
|||
FROM eclipse-temurin:21-jdk AS builder
|
||||
WORKDIR /app
|
||||
COPY backend/gradlew ./
|
||||
COPY backend/gradle/ ./gradle/
|
||||
COPY backend/build.gradle backend/settings.gradle ./
|
||||
RUN chmod +x gradlew && ./gradlew dependencies --no-daemon -q
|
||||
COPY backend/src ./src
|
||||
RUN ./gradlew bootJar --no-daemon -q
|
||||
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/build/libs/*-SNAPSHOT.jar ./app.jar
|
||||
COPY --from=builder /app/backend/build/libs/*-SNAPSHOT.jar ./app.jar
|
||||
USER bilhej
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["java", "-jar", "app.jar"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue