antonypamo commited on
Commit
700284c
·
verified ·
1 Parent(s): ad5462e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -11
Dockerfile CHANGED
@@ -1,18 +1,32 @@
1
- FROM python:3.9-slim-buster
 
 
 
 
 
 
2
 
3
  WORKDIR /app
4
 
5
- # Install system dependencies if any (none for now)
 
 
 
 
 
 
 
 
6
 
7
- # Copy and install Python dependencies
8
- COPY requirements.txt .
9
- RUN pip install --no-cache-dir -r requirements.txt
10
 
11
- # Copy the application code
12
- COPY app.py .
13
 
14
- # Expose the port FastAPI runs on
15
- EXPOSE 8000
 
16
 
17
- # Command to run the application
18
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ # ============================
2
+ # Dockerfile – Savant RRF Φ12.0 API
3
+ # ============================
4
+ FROM python:3.11-slim
5
+
6
+ ENV DEBIAN_FRONTEND=noninteractive \
7
+ PYTHONUNBUFFERED=1
8
 
9
  WORKDIR /app
10
 
11
+ # Dependencias de sistema mínimas
12
+ RUN apt-get update && apt-get install -y --no-install-recommends \
13
+ build-essential \
14
+ git \
15
+ && rm -rf /var/lib/apt/lists/*
16
+
17
+ # Instalar dependencias Python
18
+ COPY requirements.txt /app/requirements.txt
19
+ RUN pip install --no-cache-dir -r /app/requirements.txt
20
 
21
+ # Copiar el código de la API
22
+ COPY main.py /app/main.py
 
23
 
24
+ # Hugging Face token (en Spaces configúralo como secret HF_TOKEN)
25
+ ENV HF_TOKEN=""
26
 
27
+ # Puerto (HF Spaces suele usar 7860, pero respeta $PORT si está definido)
28
+ ENV PORT=7860
29
+ EXPOSE 7860
30
 
31
+ # Lanzar FastAPI con uvicorn usando el puerto del entorno
32
+ CMD ["bash", "-c", "uvicorn main:app --host 0.0.0.0 --port ${PORT}"]