Download Dockerfile from golemet/nut: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/spaces/golemet/nut/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/golemet/nut/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/golemet/nut/resolve/main/Dockerfile
1.38 kB
| # Imagen base ligera y estable con Python 3.10 | |
| FROM python:3.10-slim | |
| # Evitar que Python genere archivos .pyc | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| # Instalar dependencias del sistema necesarias para transformers y torch | |
| RUN apt-get update && apt-get install -y \ | |
| gcc \ | |
| g++ \ | |
| git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Crear el directorio de la app | |
| WORKDIR /app | |
| # Instalar herramientas necesarias ANTES de descargar efemérides | |
| RUN apt-get update && apt-get install -y \ | |
| curl \ | |
| unzip \ | |
| build-essential \ | |
| && apt-get clean | |
| # Copiar requirements | |
| COPY requirements.txt . | |
| # Actualizar pip antes de instalar dependencias | |
| RUN pip install --upgrade pip | |
| # Instalar las dependencias | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copiar el código fuente | |
| #COPY app.py /app/ | |
| # Copiar el código | |
| COPY . . | |
| # Crear carpeta de efemérides | |
| #RUN mkdir -p /app/ephemeris | |
| RUN mkdir -p /users/ephe/ | |
| # Descargar efemérides SwissEph | |
| RUN curl -L https://github.com/aloistr/swisseph/archive/refs/heads/master.zip -o swisseph.zip \ | |
| && unzip swisseph.zip \ | |
| && mv swisseph-master/ephe/* /users/ephe/ \ | |
| && rm -rf swisseph.zip swisseph-master | |
| RUN ls -lah /users/ephe/ | |
| # Exponer el puerto (FastAPI por HuggingFace normalmente usa 7860) | |
| EXPOSE 7860 | |
| # Comando de ejecución | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |