Skip to content

Commit 8727901

Browse files
committed
[CICD] Dockerfile 수정
1 parent 585c98d commit 8727901

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

Dockerfile

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,21 @@
22
FROM gradle:7.6-jdk17-alpine as builder
33
WORKDIR /build
44

5-
# Only download dependencies if build.gradle or settings.gradle changes
5+
# Copy Gradle settings
66
COPY 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
1012
COPY . /build
11-
RUN gradle build -x test
13+
RUN gradle build -x test --parallel --info
1214

1315
# Final runtime image
1416
FROM openjdk:17.0-slim
1517
WORKDIR /app
16-
17-
# Copy JAR file from builder
1818
COPY --from=builder /build/build/libs/*-SNAPSHOT.jar ./app.jar
19-
20-
# Set appropriate permissions for non-root user
2119
RUN chown nobody:nogroup /app
22-
23-
# Run as non-root user
2420
USER nobody
25-
26-
# Expose application port
2721
EXPOSE 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"]

0 commit comments

Comments
 (0)