-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (34 loc) · 1.57 KB
/
Dockerfile
File metadata and controls
44 lines (34 loc) · 1.57 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
FROM gradle:jdk25 AS builder
WORKDIR /workspace
# Layer 1: Build config and dependency resolution — cached until build files change
COPY settings.gradle.kts build.gradle.kts gradle.properties ./
COPY gradle/ gradle/
COPY build-logic/ build-logic/
COPY banking/build.gradle.kts banking/build.gradle.kts
COPY counter/build.gradle.kts counter/build.gradle.kts
COPY chess-game/settings.gradle.kts chess-game/build.gradle.kts chess-game/
COPY chess-game/app/build.gradle.kts chess-game/app/
COPY chess-game/db/build.gradle.kts chess-game/db/
COPY welcome/build.gradle.kts welcome/build.gradle.kts
RUN gradle dependencies --no-daemon 2>/dev/null || true
# Layer 2: Source code — only this layer rebuilds when sources change
COPY banking/ banking/
COPY counter/ counter/
COPY chess-game/ chess-game/
COPY welcome/ welcome/
# Tests already run on the dedicated CI `build` job on Linux. The image
# build's job is packaging only — `installDist` covers compile + assemble +
# stage. The final-stage `RUN xtc run ... welcomeTest` below provides a
# runtime smoke check on the produced image.
RUN gradle installDist --no-daemon
# Stage 2: Grab the XVM runtime from its official image
FROM ghcr.io/xtclang/xvm:latest AS xvm
# Stage 3: Runtime image with compiled modules and XVM
FROM eclipse-temurin:25-jre
COPY --from=xvm /opt/xdk/ /opt/xdk/
COPY --from=builder /workspace/build/install/examples/lib/ /opt/examples/lib/
ENV PATH="/opt/xdk/bin:${PATH}"
# Verify: run the welcomeTest module
RUN xtc run -L /opt/examples/lib welcomeTest
ENTRYPOINT ["xtc"]
CMD ["run", "-L", "/opt/examples/lib", "welcomeTest"]