Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (38 loc) · 2 KB
/
Copy pathDockerfile
File metadata and controls
48 lines (38 loc) · 2 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
41
42
43
44
45
46
47
48
FROM eclipse-temurin:25-jdk AS build
ARG GITHUB_USER
WORKDIR /workspace
# copy "static" files first to improve layer caching
COPY gradle/ gradle/
COPY gradlew build.gradle.kts settings.gradle.kts ./
COPY src/ src/
COPY lit-worker/ lit-worker/
COPY lod-worker/ lod-worker/
COPY lod-format/ lod-format/
COPY lod-runtime/build.gradle.kts lod-runtime/build.gradle.kts
# Use locked caches to avoid corruption on parallel builds
RUN --mount=type=cache,target=/root/.gradle/caches,sharing=locked \
--mount=type=cache,target=/root/.gradle/wrapper,sharing=locked \
--mount=type=secret,id=github_token,required=true \
--mount=type=secret,id=gradle_init,target=/root/.gradle/init.d/grounds-maven-mirror.init.gradle.kts,required=false \
/bin/sh -euc '\
: "${GITHUB_USER:?GITHUB_USER build arg is required}"; \
umask 077; \
trap "rm -f /root/.gradle/gradle.properties" EXIT; \
printf "github.token=%s\norg.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g\n" "$(cat /run/secrets/github_token)" > /root/.gradle/gradle.properties; \
./gradlew --no-daemon --stacktrace \
-Pgithub.user="${GITHUB_USER}" \
-Pkotlin.compiler.execution.strategy=in-process \
quarkusBuild :lit-worker:installDist :lod-worker:installDist -x test \
'
FROM gcr.io/distroless/java25-debian13 AS runtime
WORKDIR /deployments/quarkus-app
USER 65532:65532
COPY --from=build --chown=nonroot:nonroot /workspace/build/quarkus-app/ ./
# The lit worker: a plain JVM program with Minestom, run as a Job from this same image. Kept out
# of the service's classpath, whose Quarkus platform pins libraries Minestom needs newer.
COPY --from=build --chown=nonroot:nonroot /workspace/lit-worker/build/install/lit-worker/ /deployments/lit-worker/
COPY --from=build --chown=nonroot:nonroot /workspace/lod-worker/build/install/lod-worker/ /deployments/lod-worker/
EXPOSE 9000
# The default remains the service; callers can override CMD with the standalone worker command.
ENTRYPOINT ["java"]
CMD ["-jar", "quarkus-run.jar"]