# Stable Diffusion for Mac/Linux
# Note: For Apple Silicon (MPS), run natively - Docker uses CPU only
# For NVIDIA GPUs, use nvidia-container-toolkit

FROM python:3.11-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    wget \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements first for better caching
COPY requirements.txt .

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY *.py .
COPY README.md .

# Create directory for generated images
RUN mkdir -p generated_images

# Expose Gradio port
EXPOSE 7860

# Default command: run WebUI
CMD ["python", "webui.py"]
