Pingul commited on
Commit
37fde04
·
verified ·
1 Parent(s): ab75598

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Imagen base ligera con Python
2
+ FROM python:3.10-slim
3
+
4
+ # Evita que Python guarde .pyc y buffers
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV PYTHONUNBUFFERED=1
7
+
8
+ # Instalar dependencias del sistema necesarias para rasterio
9
+ RUN apt-get update && apt-get install -y \
10
+ gdal-bin \
11
+ libgdal-dev \
12
+ libgeos-dev \
13
+ libproj-dev \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Crear directorio de la app
17
+ WORKDIR /app
18
+
19
+ # Copiar dependencias primero
20
+ COPY requirements.txt .
21
+
22
+ # Instalar dependencias de Python
23
+ RUN pip install --no-cache-dir -r requirements.txt
24
+
25
+ # Copiar todo el código
26
+ COPY . .
27
+
28
+ # Exponer puerto para Hugging Face Spaces
29
+ EXPOSE 7860
30
+
31
+ # Comando para arrancar FastAPI con Uvicorn
32
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]