-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (33 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
42 lines (33 loc) · 1.09 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
# Use a slim version of Python 3.11/3.12
FROM python:3.11-slim
# Set environment variables for better Python performance in Docker
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Install system dependencies for PDF processing (Poppler/Tesseract)
RUN apt-get update && apt-get install -y \
build-essential \
curl \
libgl1 \
libglib2.0-0 \
tesseract-ocr \
libtesseract-dev \
poppler-utils \
&& rm -rf /var/lib/apt/lists/*
# Check if CUDA should be installed
ARG INSTALL_CUDA=false
RUN if [ "$INSTALL_CUDA" = "true" ]; then \
apt-get update && apt-get install -y \
cuda \
libcupti-dev \
&& rm -rf /var/lib/apt/lists/*; \
fi
# Copy only requirements.txt first to leverage Docker cache
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy only the necessary project files
COPY app.py core/ config/ rag_source/ .
# Streamlit uses port 8501 by default
EXPOSE 8501
# The command now points to app.py
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]