-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (35 loc) · 1.44 KB
/
Copy pathDockerfile
File metadata and controls
43 lines (35 loc) · 1.44 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
33
34
35
36
37
38
39
40
41
42
43
# lazy-paper container — system-isolated runtime for cross-platform use.
# Build: docker build -t lazy-paper .
# Run: docker run --rm -v $(pwd)/runs:/app/runs -v $(pwd)/.env:/app/.env:ro lazy-paper run --pdf ... --template ...
#
# Notes:
# - Uses the official uv image to keep image size tight (~280 MB after build).
# - Mounts: bring your own runs/ + 参考文献/ + .env via -v at run-time.
# - No GPU needed; OCR + LLM are cloud APIs.
# - Includes Pango/Cairo/gdk-pixbuf for WeasyPrint (PDF output) — these are the
# same libs macOS users get via `brew install pango gdk-pixbuf libffi cairo`.
FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim
ENV UV_LINK_MODE=copy \
UV_COMPILE_BYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
# System libs required by weasyprint (HTML→PDF rendering).
RUN apt-get update && apt-get install -y --no-install-recommends \
libpango-1.0-0 libpangoft2-1.0-0 \
libcairo2 libgdk-pixbuf-2.0-0 \
libffi8 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install deps first (cache-friendly)
COPY pyproject.toml uv.lock* ./
RUN uv sync --frozen --no-install-project
# Project sources
COPY cli.py ./
COPY conftest.py ./
COPY stages ./stages
COPY llm ./llm
# Install the project itself (editable not needed inside container)
RUN uv sync --frozen
# Default entry: invoke the CLI; users pass `run --pdf ... --template ...`
ENTRYPOINT ["uv", "run", "python", "-m", "cli"]
CMD ["--help"]