FROM python:3.11-slim WORKDIR /app # git is required for the clanker-soul git+https dependency (slim image lacks it) RUN apt-get update && apt-get install -y --no-install-recommends git \ && rm -rf /var/lib/apt/lists/* COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY engine/ ./engine/ COPY app/ ./app/ COPY static/ ./static/ RUN mkdir -p /app/data ENV SOUL_DB=/app/data/soul.db EXPOSE 7860 # --proxy-headers + forwarded-allow-ips so uvicorn honors HF's X-Forwarded-Proto # (otherwise OAuth builds an http:// redirect_uri and HF rejects the login) CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--proxy-headers", "--forwarded-allow-ips", "*"]