File size: 682 Bytes
bff6d5b
5738cc0
 
53d2856
 
 
 
 
5738cc0
 
53d2856
bff6d5b
 
53d2856
 
 
 
 
 
 
 
 
 
5738cc0
53d2856
bff6d5b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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"]