# Use official Python base image FROM python:3.10-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Set work directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ libgl1-mesa-glx \ libglib2.0-0 \ texlive-latex-base \ texlive-fonts-recommended \ texlive-latex-extra \ && rm -rf /var/lib/apt/lists/* # Clean up RUN rm -rf /var/lib/apt/lists/* # Install Poetry RUN pip install --upgrade pip RUN pip install poetry # Copy only poetry files first (for caching) COPY pyproject.toml poetry.lock* /app/ # Install dependencies RUN poetry config virtualenvs.create false \ && poetry install --no-root --no-interaction --no-ansi # Copy the rest of the application COPY . /app # Expose Gradio port EXPOSE 7860 # Command to run the app CMD ["python", "ragntex.py"]