FROM python:3.10-slim # Prevent Python buffering & writing bytecode ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 WORKDIR /app # 1. Install all Linux tools needed by your converters RUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg \ libreoffice \ pandoc \ potrace \ imagemagick \ p7zip-full \ unzip \ libcairo2 \ libheif-dev \ && rm -rf /var/lib/apt/lists/* # 2. Copy requirements & install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # 3. Copy project files COPY . . # 4. Create working folders with full permissions RUN mkdir -p static/output tmp temp && chmod -R 777 static tmp temp # 5. Port 7860 for Hugging Face Spaces EXPOSE 7860 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]