mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-08-07 21:01:14 +00:00
add dockerfile, add get-metadata.sh, docker-build.sh
This commit is contained in:
34
Dockerfile
Normal file
34
Dockerfile
Normal 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"]
|
Reference in New Issue
Block a user