Team Ai
Apppublic

shailex/stable-diffusion-api

sourceHugging Faceupdated 2y agoView on Hugging Face
1likes
Dockerfile32 linesDownload Raw Back to root
1FROM python:3.10-slim2 3WORKDIR /app4 5# Install system dependencies6RUN apt-get update && apt-get install -y \7    build-essential \8    git \9    && rm -rf /var/lib/apt/lists/*10 11# Create a cache directory with proper permissions12RUN mkdir -p /app/.cache && \13    chmod 777 /app/.cache14 15# Set environment variables for cache locations16ENV TRANSFORMERS_CACHE=/app/.cache/huggingface/transformers17ENV HF_HOME=/app/.cache/huggingface18ENV HF_DATASETS_CACHE=/app/.cache/huggingface/datasets19 20# Copy requirements first for better layer caching21COPY requirements.txt .22RUN pip install --no-cache-dir -r requirements.txt23 24# Copy the application code25COPY app.py .26 27# Expose the port28EXPOSE 786029 30# Command to run the application31CMD ["python", "app.py"]32