Update docker
Browse files12345678910111213141516171819202122232425262728293031323334# Use Python 3.10 (Stable for LangChain & Flashrank)FROM python:3.10-slim# Set the working directory to /appWORKDIR /app# Install system dependencies (needed for compiling packages like flashrank)RUN apt-get update && apt-get install -y \build-essential \&& rm -rf /var/lib/apt/lists/*# Copy requirements first to cache dependenciesCOPY requirements.txt .# Install Python dependencies# --no-cache-dir keeps the image size smallerRUN pip install --no-cache-dir -r requirements.txt# Copy all your code (app_1.py, src/, templates/, api.py) into the containerCOPY . .# Create writable directories for the database and file uploads# The 'chmod -R 777' gives the container permission to write hereRUN mkdir -p /app/chroma_db && chmod -R 777 /app/chroma_dbRUN mkdir -p /app/Uploads && chmod -R 777 /app/Uploads# Tell Docker that the container will listen on port 7860EXPOSE 7860# --- The Command to Run Your App ---# We use Gunicorn, a production-grade server# It looks for the 'app_1.py' file and the 'app' object inside it# --timeout 300 gives your RAG system 5 minutes to respond before timing outCMD ["gunicorn", "-b", "0.0.0.0:7860", "app_1:app", "--timeout", "300"]12345678910111213141516171819202122232425262728293031323334# Use Python 3.10 (Stable for LangChain & Flashrank)FROM python:3.10-slim# Set the working directory to /appWORKDIR /app# Install system dependencies (needed for compiling packages like flashrank)RUN apt-get update && apt-get install -y \build-essential \&& rm -rf /var/lib/apt/lists/*# Copy requirements first to cache dependenciesCOPY requirements.txt .# Install Python dependencies# --no-cache-dir keeps the image size smallerRUN pip install --no-cache-dir -r requirements.txt# Copy all your code (app_1.py, src/, templates/, api.py) into the containerCOPY . .# Create writable directories for the database and file uploads# The 'chmod -R 777' gives the container permission to write hereRUN mkdir -p /app/chroma_db && chmod -R 777 /app/chroma_dbRUN mkdir -p /app/Uploads && chmod -R 777 /app/Uploads# Tell Docker that the container will listen on port 7860EXPOSE 7860# --- The Command to Run Your App ---# We use Gunicorn, a production-grade server# It looks for the 'app_1.py' file and the 'app' object inside it# --timeout 300 gives your RAG system 5 minutes to respond before timing outCMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app", "--timeout", "300"]
docker+34-34