-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (45 loc) · 2.5 KB
/
Copy pathDockerfile
File metadata and controls
56 lines (45 loc) · 2.5 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
49
50
51
52
53
54
55
56
# ──────────────────────────────────────────────────────────────────────────────
# Stage 1 – builder
#
# Uses a JDK image with a reliable Gradle toolchain. The entire Karpfen
# subproject tree is compiled here; the resulting installDist distribution is
# what we carry over to the runtime stage.
# ──────────────────────────────────────────────────────────────────────────────
FROM eclipse-temurin:21-jdk AS builder
WORKDIR /build
# Copy the full karpfen-runtime source tree (build context = karpfen-runtime/)
COPY . .
# Build the distribution, skip tests for speed
RUN ./gradlew installDist -x test --no-daemon --quiet
# ──────────────────────────────────────────────────────────────────────────────
# Stage 2 – runtime (Debian Trixie)
#
# Minimal image: only the JRE and Python 3 are installed.
# application.conf is NOT baked in — it is bind-mounted by run_docker.sh.
# Trace logs go to /app/logs, which run_docker.sh mounts from the host so that
# log files survive container shutdown.
# ──────────────────────────────────────────────────────────────────────────────
FROM debian:trixie-slim AS runtime
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
openjdk-21-jre-headless \
python3 \
python3-pip \
&& pip3 install --break-system-packages \
numpy \
scipy \
sympy \
pandas \
regex \
python-dateutil \
chardet \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the compiled distribution from the builder stage
COPY --from=builder /build/build/install/karpfen-runtime/lib/ ./lib/
COPY --from=builder /build/build/install/karpfen-runtime/bin/ ./bin/
# /app/logs is the container-side mount point for trace log files.
# Mount a host directory here via -v <host-path>:/app/logs to persist traces.
VOLUME ["/app/logs"]
EXPOSE 8080
ENTRYPOINT ["./bin/karpfen-runtime"]