# 1) Imagen base con PyTorch + CUDA 11.7 (T4 compatible) | |
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime | |
# 2) Redirige el cache de HF/transformers a un dir dentro de /app | |
ENV HF_HOME=/app/.cache \ | |
TRANSFORMERS_CACHE=/app/.cache \ | |
XDG_CACHE_HOME=/app/.cache | |
WORKDIR /app | |
# 3) Copia todo el repo (incluye test.jpg, run.py, etc.) | |
COPY . . | |
# 4) Crea la carpeta de caché y instala deps | |
RUN mkdir -p /app/.cache && \ | |
pip install --no-cache-dir \ | |
sam2 \ | |
torch \ | |
transformers \ | |
diffusers \ | |
huggingface_hub \ | |
numpy \ | |
Pillow | |
# 5) Al arranque, ejecuta run.py (usará test.jpg y prompt por defecto) | |
ENTRYPOINT ["python", "run.py"] | |