# Use Python 3.11 slim image FROM python:3.11-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 ENV PORT=7860 # Set working directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ && rm -rf /var/lib/apt/lists/* # Copy backend requirements and install COPY backend/requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Download SpaCy model (use pip directly to avoid CLI URL issues) RUN pip install --no-cache-dir https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1-py3-none-any.whl # Copy backend code (including the dist folder we built) COPY backend/ ./backend/ # Change to backend directory to run the app WORKDIR /app/backend # Create uploads directory RUN mkdir -p data/uploads # Expose the port EXPOSE 7860 # Run the application CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]