dockerfile update

This commit is contained in:
dalbodeule 2024-07-27 10:20:32 +09:00
parent c669943f87
commit 2b999c5acb
No known key found for this signature in database
GPG Key ID: EFA860D069C9FA65

View File

@ -1,23 +1,10 @@
# Stage 1: Build the JAR file
FROM gradle:jdk21 as build
WORKDIR /app
# Copy the Gradle files and source code
COPY build.gradle.kts settings.gradle.kts gradlew gradle.properties ./
COPY gradle gradle
COPY src src
# Build the project using Gradle
RUN ./gradlew build
# Stage 2: Run the JAR file using JDK 21
# Use a base image with JDK 21 for the final image
FROM openjdk:21-jdk
WORKDIR /app
# Copy the JAR file from the build stage
COPY --from=build /app/build/libs/*.jar app.jar
# Copy the JAR file from the TeamCity build artifacts
COPY build/libs/chzzk_bot-*.jar app.jar
# Set the entry point
ENTRYPOINT ["java", "-jar", "app.jar"]