Mution commited on
Commit
0b4b888
·
verified ·
1 Parent(s): e17d27e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -6
Dockerfile CHANGED
@@ -1,19 +1,20 @@
 
1
  FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
5
- # Instalamos git por si alguna librería lo requiere al compilar
6
  RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
7
 
8
- # Copiamos primero los requerimientos para optimizar la caché de Docker
9
  COPY requirements.txt .
10
- RUN pip install --no-cache-dir -r requirements.txt
11
 
12
- # Copiamos el resto de los archivos del servidor
 
 
 
13
  COPY . .
14
 
15
- # Puerto expuesto para Hugging Face Spaces
16
  EXPOSE 7860
17
 
18
- # Comando de arranque
19
  CMD ["python", "app.py"]
 
1
+ # Usamos una imagen que soporta PyTorch y la CPU/GPU
2
  FROM python:3.9-slim
3
 
4
  WORKDIR /app
5
 
6
+ # Instalamos git (necesario para descargar modelos)
7
  RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
8
 
 
9
  COPY requirements.txt .
 
10
 
11
+ # Instalamos las dependencias
12
+ RUN pip install --no-cache-dir --upgrade pip && \
13
+ pip install --no-cache-dir -r requirements.txt
14
+
15
  COPY . .
16
 
17
+ # Exponemos el puerto de Hugging Face
18
  EXPOSE 7860
19
 
 
20
  CMD ["python", "app.py"]