forked from Marker-Inc-Korea/AutoRAG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (34 loc) · 1.03 KB
/
Dockerfile
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
# Base stage: Install dependencies
FROM python:3.10-slim AS base
# Install system dependencies
RUN apt-get update && \
apt-get install -y \
build-essential \
gcc \
libssl-dev \
poppler-utils \
tesseract-ocr \
tesseract-ocr-eng \
tesseract-ocr-kor && \
rm -rf /var/lib/apt/lists/*
# Set work directory
WORKDIR /usr/src/app
# Install Python dependencies
RUN pip install --upgrade pip setuptools setuptools-scm
COPY requirements.txt /usr/src/app/requirements.txt
RUN pip install -r requirements.txt
# Copy project files
COPY . /usr/src/app
RUN pip install -e ./
# Test stage: Run tests if CI=true
FROM base AS test
# Install testing dependencies
RUN pip install pytest pytest-xdist
# Run tests if CI is set to true
RUN pytest -o log_cli=true --log-cli-level=INFO -n auto tests
# Production stage: Create final image for production
FROM base AS production
COPY projects /usr/src/app/projects
# Set the entrypoint for the production application
ENTRYPOINT ["python", "-m", "autorag.cli"]
# ENTRYPOINT ["bash"]