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
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:
@@ -1,19 +1,15 @@
|
|||||||
# Timetable solver — Timefold needs a JVM at runtime, so this image bundles
|
# Timetable solver — Timefold needs a JVM at runtime (it's a JPype wrapper
|
||||||
# OpenJDK 17 alongside Python 3.11.
|
# around the Java engine). We install OpenJDK 17 alongside Python 3.11 on
|
||||||
FROM eclipse-temurin:17-jdk-alpine AS jdk
|
# the slim Debian base so the same image works on ARM64 and x86_64.
|
||||||
|
|
||||||
FROM python:3.11-slim
|
FROM python:3.11-slim
|
||||||
|
|
||||||
# Pull the JVM from the temurin image so we don't shell out to apt for a JDK
|
ENV JAVA_HOME=/usr/lib/jvm/default-java
|
||||||
# (which on slim adds ~400 MB).
|
|
||||||
COPY --from=jdk /opt/java/openjdk /opt/java/openjdk
|
|
||||||
ENV JAVA_HOME=/opt/java/openjdk
|
|
||||||
ENV PATH="${JAVA_HOME}/bin:${PATH}"
|
ENV PATH="${JAVA_HOME}/bin:${PATH}"
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install runtime deps the JVM bridge needs.
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
default-jdk-headless \
|
||||||
libgomp1 \
|
libgomp1 \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
@@ -24,7 +20,7 @@ COPY app ./app
|
|||||||
|
|
||||||
EXPOSE 8095
|
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 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"]
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8095"]
|
||||||
|
|||||||
Reference in New Issue
Block a user