Maksym Batiuk
Initial commit
417c52d
raw
history blame
992 Bytes
# Base image
FROM python:3.12
# Set working directory inside the container
WORKDIR /app/rag-system
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libpoppler-cpp-dev \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
# Install Poetry
RUN pip install --no-cache-dir poetry
# Copy project files
COPY poetry.lock pyproject.toml /app/
COPY rag-system /app/rag-system/
# Set environment variables
ENV PYTHONPATH=/app/rag-system/src
ENV TOKENIZERS_PARALLELISM=false
ENV TORCH_CPP_LOG_LEVEL=ERROR
ENV PYTORCH_DISABLE_SYSTEM_MONITORING=1
# Configure Poetry
RUN poetry config virtualenvs.create false
# Install dependencies with Poetry
RUN poetry install --no-root --no-dev
# Run preprocessing
RUN python3 -m src.preprocessing
# Expose the app's default port
EXPOSE 7860
# Command to start the app
CMD ["python3", "app.py"]