3v324v23's picture
Add Excel Add-in v2.1.0 with static files
d9dc826
raw
history blame
1.08 kB
# Dockerfile optimizado para HuggingFace Spaces
FROM python:3.11-slim
# Variables de entorno
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PORT=7860
# Directorio de trabajo
WORKDIR /app
# Instalar dependencias del sistema
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copiar requirements
COPY requirements.txt .
# Instalar dependencias Python
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copiar c贸digo de la aplicaci贸n
COPY app/ ./app/
# Copiar archivos est谩ticos del Excel Add-in
COPY static/ ./static/
# Crear usuario no-root
RUN useradd -m -u 1000 user && \
chown -R user:user /app
USER user
# Exponer puerto (HF Spaces usa 7860 por defecto)
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:7860/health || exit 1
# Comando de inicio
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]