content: ### Builder stage ###
  FROM python:3.10-slim as builder
  
  WORKDIR /app
  
  # Install build dependencies
  RUN apt-get update && apt-get install -y \
      build-essential \
      && rm -rf /var/lib/apt/lists/*
  
  # Install requirements
  RUN python -m venv /opt/venv
  ENV PATH="/opt/venv/bin:$PATH"
  
  COPY ComfyUI-fastapi/requirements.txt .
  RUN pip install --no-cache-dir -r requirements.txt
  
  
  ### Runtime stage ###
  FROM python:3.10-slim as runtime
  
  WORKDIR /app
  
  COPY --from=builder /opt/venv /opt/venv
  ENV PATH="/opt/venv/bin:$PATH"
  
  COPY ComfyUI-fastapi/ .
  
  # Set Port
  EXPOSE 8000
  
  # Deploy the application
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] 