From 1f2f3047243932c10149a494e09bdc74f67b7be1 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Fri, 22 May 2026 00:19:03 +0200 Subject: [PATCH] Use default-jdk-headless on python:slim instead of temurin:alpine 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) --- timetable-solver-service/Dockerfile | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/timetable-solver-service/Dockerfile b/timetable-solver-service/Dockerfile index 6b28763..3374563 100644 --- a/timetable-solver-service/Dockerfile +++ b/timetable-solver-service/Dockerfile @@ -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"]