-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (34 loc) · 1.48 KB
/
Dockerfile
File metadata and controls
46 lines (34 loc) · 1.48 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
44
45
46
# ── Build stage ────────────────────────────────────────────────────────
FROM python:3.12-slim AS builder
WORKDIR /build
# Install system dependencies for binary format handlers
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
COPY pyproject.toml MANIFEST.in README.md LICENSE ./
COPY contextifier/ contextifier/
RUN pip install --no-cache-dir build \
&& python -m build --wheel
# ── Runtime stage ─────────────────────────────────────────────────────
FROM python:3.12-slim
LABEL maintainer="CocoRoF <gkfua00@gmail.com>"
LABEL description="Contextifier — AI-ready document processing"
# Install Tesseract OCR + Poppler (for pdf2image) + system deps
RUN apt-get update && apt-get install -y --no-install-recommends \
tesseract-ocr \
tesseract-ocr-kor \
tesseract-ocr-eng \
poppler-utils \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install the built wheel
COPY --from=builder /build/dist/*.whl /tmp/
RUN pip install --no-cache-dir /tmp/*.whl \
&& rm -rf /tmp/*.whl
# Non-root user for security
RUN useradd --create-home --shell /bin/bash contextifier
USER contextifier
# Default working directory for documents
WORKDIR /data
ENTRYPOINT ["python", "-m", "contextifier"]