-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (29 loc) · 1.15 KB
/
Dockerfile
File metadata and controls
40 lines (29 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
########################
# Build native (Quarkus + Gradle) using containerized Mandrel/GraalVM
########################
FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21 AS build
WORKDIR /project
ARG APP_VERSION=0.0.0-dev
ENV APP_VERSION=${APP_VERSION}
USER quarkus
# Copy Gradle wrapper + build configuration first for better caching
COPY --chown=quarkus:quarkus gradle/ gradle/
COPY --chown=quarkus:quarkus gradlew settings.gradle* build.gradle.kts* gradle.properties ./
# Pre-fetch dependencies (optional but helps cache). Don't fail if no such tasks yet.
RUN ./gradlew --no-daemon -S build -x test || true
# Copy sources
COPY --chown=quarkus:quarkus src/ src/
# Build native executable
RUN ./gradlew --no-daemon -S clean build -x test -Dquarkus.native.enabled=true -Dquarkus.package.jar.enabled=false
########################
# Run native
########################
FROM debian:13-slim AS runtime
# TODO: Install required packages
RUN apt update && apt upgrade -y
# Copy the native runner. Quarkus typically produces *-runner in build/
COPY --from=build /project/build/*-runner /app/application
WORKDIR /app
EXPOSE 8080
USER 1001
CMD ["/app/application"]