diff --git a/Containerfile b/Containerfile index 859884e..42cc1a5 100644 --- a/Containerfile +++ b/Containerfile @@ -30,12 +30,11 @@ RUN pip install --no-cache-dir --break-system-packages \ pip install --no-cache-dir --break-system-packages flask gunicorn # ---- font: download GoNotoCurrent-Regular.ttf at build time ---- -# Find the marker package dir inside the installed package -RUN MARKER_DIR=$(python3 -c "import marker; print(marker.__path__[0])") && \ - mkdir -p "$MARKER_DIR/static/fonts" && \ - curl -sL -o "$MARKER_DIR/static/fonts/GoNotoCurrent-Regular.ttf" \ +RUN FONT_DIR=$(python3 -c "from marker.settings import settings; import os; print(os.path.dirname(settings.FONT_PATH))") && \ + mkdir -p "$FONT_DIR" && \ + curl -sL -o "$FONT_DIR/GoNotoCurrent-Regular.ttf" \ "https://models.datalab.to/artifacts/GoNotoCurrent-Regular.ttf" && \ - chown marker:marker "$MARKER_DIR/static/fonts/GoNotoCurrent-Regular.ttf" + chown -R marker:marker "$FONT_DIR" # ---- final image ---- COPY app.py /app/