-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerFile.pdfMath
More file actions
32 lines (23 loc) · 1.53 KB
/
DockerFile.pdfMath
File metadata and controls
32 lines (23 loc) · 1.53 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
#FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
FROM ghcr.milu.moe/astral-sh/uv:python3.13-bookworm-slim
WORKDIR /app
EXPOSE 7861
ENV PYTHONUNBUFFERED=1
# # Download all required fonts
# ADD "https://github.com/satbyy/go-noto-universal/releases/download/v7.0/GoNotoKurrent-Regular.ttf" /app/
# ADD "https://github.com/timelic/source-han-serif/releases/download/main/SourceHanSerifCN-Regular.ttf" /app/
# ADD "https://github.com/timelic/source-han-serif/releases/download/main/SourceHanSerifTW-Regular.ttf" /app/
# ADD "https://github.com/timelic/source-han-serif/releases/download/main/SourceHanSerifJP-Regular.ttf" /app/
# ADD "https://github.com/timelic/source-han-serif/releases/download/main/SourceHanSerifKR-Regular.ttf" /app/
RUN apt-get update && \
apt-get install --no-install-recommends -y libgl1 libglib2.0-0 libxext6 libsm6 libxrender1 build-essential && \
rm -rf /var/lib/apt/lists/*
COPY pyproject.toml .
RUN uv pip install --system --no-cache -r pyproject.toml && babeldoc --version && babeldoc --warmup
COPY . .
# Calls for a random number to break the cahing of babeldoc upgrade
# (https://stackoverflow.com/questions/35134713/disable-cache-for-specific-run-commands/58801213#58801213)
ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache
RUN uv pip install --system --no-cache . && uv pip install --system --no-cache --compile-bytecode -U babeldoc "pymupdf<1.25.3" && babeldoc --version && babeldoc --warmup
RUN python -c "import importlib.metadata as m; print(m.version('pdf2zh-next'))"
CMD ["pdf2zh_api"]