forked from Marker-Inc-Korea/AutoRAG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.base
71 lines (61 loc) · 1.86 KB
/
Dockerfile.base
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Base stage: Install common dependencies
FROM python:3.10-slim AS base
# Set working directory and environment variables
WORKDIR /usr/src/app
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1
# Copy only requirements files first to leverage Docker cache
COPY pyproject.toml ./
# Install system and Python dependencies in a single layer
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
gcc \
libssl-dev && \
pip install --upgrade pip setuptools setuptools-scm && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /root/.cache/pip/*
# Copy project files
COPY . .
# Install base project
RUN pip install -e ./ && \
rm -rf /root/.cache/pip/*
# Ko stage with minimal dependencies
FROM base AS ko
RUN pip install --no-cache-dir "AutoRAG[ko]" && \
rm -rf /root/.cache/pip/*
ENTRYPOINT ["python", "-m", "autorag.cli"]
# Dev stage with all development tools
FROM base AS dev
RUN pip install --no-cache-dir \
-r ./tests/requirements.txt \
-r ./docs/requirements.txt \
"AutoRAG[dev]" && \
rm -rf /root/.cache/pip/*
ENTRYPOINT ["python", "-m", "autorag.cli"]
# Ja stage with Japanese support
FROM base AS ja
RUN pip install --no-cache-dir "AutoRAG[ja]" && \
rm -rf /root/.cache/pip/*
ENTRYPOINT ["python", "-m", "autorag.cli"]
# API stage with minimal footprint
FROM base AS api
RUN rm -rf \
./sample_dataset \
./tests \
./docs \
/root/.cache/pip/*
ENTRYPOINT ["python", "-m", "autorag.cli"]
# Parsing stage with OCR support
FROM base AS parsing
RUN apt-get update && \
apt-get install -y --no-install-recommends \
poppler-utils \
tesseract-ocr \
tesseract-ocr-eng \
tesseract-ocr-kor && \
pip install --no-cache-dir "AutoRAG[parse]" && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /root/.cache/pip/*
ENTRYPOINT ["python", "-m", "autorag.cli"]