# Use slim Python base FROM python:3.11-slim ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Install system deps required by instaloader (libmagic optional) and build essentials RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ git \ curl \ ffmpeg \ libsm6 \ libxrender1 \ && rm -rf /var/lib/apt/lists/* # Set workdir WORKDIR /app # Copy project files COPY . /app # Install Python deps RUN pip install --no-cache-dir --upgrade pip RUN pip install --no-cache-dir fastapi uvicorn jinja2 aiofiles instaloader python-multipart # Optional: install chromadb client if you want server-side chroma integration later RUN pip install --no-cache-dir chromadb # Create downloads dir RUN mkdir -p /app/downloads # Expose HF Spaces standard port 7860 EXPOSE 7860 # Uvicorn entrypoint (bind 0.0.0.0:7860) CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--no-access-log"]