FROM python:3.10-slim WORKDIR /app # 更新 pip RUN pip install --upgrade pip # 分步安裝避免衝突 RUN pip install torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cpu RUN pip install diffusers==0.25.1 transformers==4.35.0 RUN pip install gradio==4.28.3 fastapi==0.104.0 uvicorn==0.23.2 RUN pip install accelerate==0.24.0 safetensors==0.4.0 Pillow==10.0.1 RUN pip install pydantic==2.4.2 huggingface-hub==0.19.0 requests==2.31.0 COPY . . CMD ["python", "app.py"]