Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
# Spring Boot 백엔드 배포용 Dockerfile
|
||||
FROM eclipse-temurin:21-jdk-alpine AS build
|
||||
WORKDIR /app
|
||||
|
||||
COPY gradlew ./
|
||||
COPY gradle ./gradle
|
||||
RUN chmod +x gradlew
|
||||
|
||||
COPY build.gradle settings.gradle ./
|
||||
RUN ./gradlew dependencies --no-daemon || true
|
||||
|
||||
COPY src ./src
|
||||
RUN ./gradlew bootJar --no-daemon
|
||||
|
||||
# Runtime image
|
||||
FROM eclipse-temurin:21-jre-alpine AS runner
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk add --no-cache curl
|
||||
|
||||
COPY --from=build /app/build/libs/*.jar app.jar
|
||||
|
||||
RUN mkdir -p logs uploads data && \
|
||||
chown -R nobody:nobody /app && \
|
||||
chmod -R 755 /app
|
||||
|
||||
EXPOSE 8081
|
||||
USER nobody
|
||||
CMD ["java", "-jar", "app.jar"]
|
||||
Reference in New Issue
Block a user