add dockerfile, add get-metadata.sh, docker-build.sh

This commit is contained in:
dalbodeule
2024-06-13 01:33:11 +09:00
parent 2d28bf8bcb
commit 639ed5faed
5 changed files with 282 additions and 1 deletions

34
Dockerfile Normal file
View File

@@ -0,0 +1,34 @@
# Builder Stage
FROM ghcr.io/graalvm/graalvm-ce:latest AS builder
# Install necessary tools
RUN gu install native-image
# Set working directory
WORKDIR /app
# Install dependencies
COPY build.gradle.kts settings.gradle.kts gradlew ./
COPY gradle ./gradle
RUN ./gradlew --no-daemon dependencies
# Copy the source code
COPY src ./src
# Build the application
RUN ./gradlew nativeCompile
# Runner Stage
FROM alpine:latest AS runner
# Set working directory
WORKDIR /app
# Copy the native image from the builder stage
COPY --from=builder /app/chzzk_bot .
# Ensure the application binary is executable
RUN chmod +x /app/chzzk_bot
# Run the application
CMD ["./chzzk_bot"]