da-policyengine-dev / src /main /docker /Dockerfile.native
dalabai's picture
Upload folder using huggingface_hub
9373c61 verified
raw
history blame
554 Bytes
# GraalVM Native Image - Ultra-fast startup, tiny size
# Expected size: ~50-80MB, startup <100ms
# Note: Requires native compilation support in Spring Boot
# Stage 1: Native compilation
FROM ghcr.io/graalvm/graalvm-ce:ol9-java21 as native-builder
WORKDIR /app
# Install native-image
RUN gu install native-image
# Copy source and build native executable
COPY . .
RUN ./gradlew nativeCompile
# Stage 2: Minimal runtime
FROM scratch
COPY --from=native-builder /app/build/native/nativeCompile/app /app
EXPOSE 8080
ENTRYPOINT ["/app"]