ViannyCruz commited on
Commit
376dc84
·
verified ·
1 Parent(s): 7d5362d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +2 -18
Dockerfile CHANGED
@@ -1,47 +1,31 @@
1
- # ── Imagen base con Python 3.10 ────────────────────────────────────────────────
2
  FROM python:3.10-slim
3
 
4
- # Variables de entorno
5
  ENV PYTHONDONTWRITEBYTECODE=1 \
6
  PYTHONUNBUFFERED=1 \
7
  TF_CPP_MIN_LOG_LEVEL=2 \
8
  DB_PATH=/data/medical_app.db \
9
  PORT=7860
10
 
11
- # Instalar dependencias del sistema
12
  RUN apt-get update && apt-get install -y --no-install-recommends \
13
- libgl1-mesa-glx \
14
  libglib2.0-0 \
15
  libsm6 \
16
  libxrender1 \
17
  libxext6 \
18
  && rm -rf /var/lib/apt/lists/*
19
 
20
- # Directorio de trabajo
21
  WORKDIR /app
22
 
23
- # Instalar dependencias Python primero (capa cacheada)
24
  COPY requirements.txt .
25
  RUN pip install --no-cache-dir -r requirements.txt
26
 
27
- # Copiar código fuente
28
  COPY app.py .
29
  COPY database.py .
30
-
31
- # Copiar carpeta web (frontend HTML)
32
  COPY web/ ./web/
33
-
34
- # Copiar modelo entrenado
35
- # ⚠️ Renombra tu archivo .h5 o ajusta esta línea
36
  COPY *.h5 ./
37
 
38
- # Crear directorio persistente para la base de datos
39
- # En HF Spaces, monta un Space Storage en /data para persistencia real
40
  RUN mkdir -p /data
41
 
42
- # Puerto que expone la app (HF Spaces usa 7860)
43
  EXPOSE 7860
44
 
45
- # Arranque con gunicorn (producción)
46
- CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", \
47
- "--timeout", "120", "--preload", "app:app"]
 
 
1
  FROM python:3.10-slim
2
 
 
3
  ENV PYTHONDONTWRITEBYTECODE=1 \
4
  PYTHONUNBUFFERED=1 \
5
  TF_CPP_MIN_LOG_LEVEL=2 \
6
  DB_PATH=/data/medical_app.db \
7
  PORT=7860
8
 
 
9
  RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ libgl1 \
11
  libglib2.0-0 \
12
  libsm6 \
13
  libxrender1 \
14
  libxext6 \
15
  && rm -rf /var/lib/apt/lists/*
16
 
 
17
  WORKDIR /app
18
 
 
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
 
22
  COPY app.py .
23
  COPY database.py .
 
 
24
  COPY web/ ./web/
 
 
 
25
  COPY *.h5 ./
26
 
 
 
27
  RUN mkdir -p /data
28
 
 
29
  EXPOSE 7860
30
 
31
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", "--timeout", "120", "--preload", "app:app"]