FROM python:3.9-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ cmake \ git \ libcairo2-dev \ pkg-config \ python3-dev \ libfreetype6-dev \ && rm -rf /var/lib/apt/lists/* # Copy requirements first to leverage Docker cache COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Install diffvg from the DiffSketcher project RUN pip install --no-cache-dir git+https://github.com/ximinng/DiffSketcher-project.git#subdirectory=diffvg # Copy the model files COPY . . # Set environment variables ENV PYTHONUNBUFFERED=1 ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONPATH=/app # Run the API server CMD ["python", "app.py"]