File tree Expand file tree Collapse file tree 1 file changed +7
-18
lines changed
Expand file tree Collapse file tree 1 file changed +7
-18
lines changed Original file line number Diff line number Diff line change 22FROM gradle:7.6-jdk17-alpine as builder
33WORKDIR /build
44
5- # Only download dependencies if build.gradle or settings.gradle changes
5+ # Copy Gradle settings
66COPY build.gradle settings.gradle /build/
7- RUN gradle build -x test --parallel
87
9- # Build the application
8+ # Debug Gradle file setup
9+ RUN ls -l /build && cat /build/build.gradle
10+
11+ # Build application
1012COPY . /build
11- RUN gradle build -x test
13+ RUN gradle build -x test --parallel --info
1214
1315# Final runtime image
1416FROM openjdk:17.0-slim
1517WORKDIR /app
16-
17- # Copy JAR file from builder
1818COPY --from=builder /build/build/libs/*-SNAPSHOT.jar ./app.jar
19-
20- # Set appropriate permissions for non-root user
2119RUN chown nobody:nogroup /app
22-
23- # Run as non-root user
2420USER nobody
25-
26- # Expose application port
2721EXPOSE 8080
28-
29- # Environment variables for JVM options
30- ENV JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Dsun.net.inetaddr.ttl=0"
31-
32- # Application entrypoint
33- ENTRYPOINT ["java" , "-jar" , "$JAVA_OPTS" , "app.jar" ]
22+ ENTRYPOINT ["java" , "-jar" , "/app/app.jar" ]
You can’t perform that action at this time.
0 commit comments