Use default-jdk-headless on python:slim instead of temurin:alpine
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 36s
CI / test-go-edu-search (push) Successful in 29s
CI / test-python-klausur (push) Failing after 2m34s
CI / test-python-agent-core (push) Successful in 17s
CI / test-nodejs-website (push) Successful in 23s

ARM64 has no eclipse-temurin:17-jdk-alpine manifest. Switch to the
Debian-based python:3.11-slim and install OpenJDK via apt so the
image builds on both Mac Mini (ARM) and x86_64 hosts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-05-22 00:19:03 +02:00
parent 53cfe9238f
commit 1f2f304724
+6 -10
View File
@@ -1,19 +1,15 @@
# Timetable solver — Timefold needs a JVM at runtime, so this image bundles
# OpenJDK 17 alongside Python 3.11.
FROM eclipse-temurin:17-jdk-alpine AS jdk
# Timetable solver — Timefold needs a JVM at runtime (it's a JPype wrapper
# around the Java engine). We install OpenJDK 17 alongside Python 3.11 on
# the slim Debian base so the same image works on ARM64 and x86_64.
FROM python:3.11-slim
# Pull the JVM from the temurin image so we don't shell out to apt for a JDK
# (which on slim adds ~400 MB).
COPY --from=jdk /opt/java/openjdk /opt/java/openjdk
ENV JAVA_HOME=/opt/java/openjdk
ENV JAVA_HOME=/usr/lib/jvm/default-java
ENV PATH="${JAVA_HOME}/bin:${PATH}"
WORKDIR /app
# Install runtime deps the JVM bridge needs.
RUN apt-get update && apt-get install -y --no-install-recommends \
default-jdk-headless \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
@@ -24,7 +20,7 @@ COPY app ./app
EXPOSE 8095
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8095/health')" || exit 1
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8095"]