FROM python:3.11-slim # Prevents Python from writing .pyc files and buffering stdout ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Create app directory WORKDIR /app # System deps (minimal) RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ && rm -rf /var/lib/apt/lists/* # Copy code COPY requirements.txt /app/requirements.txt RUN pip install --no-cache-dir -r /app/requirements.txt # Copy user modules COPY sender.py embbed.py retreive.py /app/ # Copy API app COPY app.py /app/app.py # Create runtime dirs RUN mkdir -p /app/runs # Expose port (HF Spaces sets $PORT; default to 7860) ENV PORT=7860 CMD ["bash", "-lc", "uvicorn app:app --host 0.0.0.0 --port ${PORT}"]