Spaces:
Paused
Paused
File size: 798 Bytes
621a86c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# Hugging Face Spaces: Docker SDK - Blank
# Builds and serves the FastAPI app at $PORT
FROM python:3.10-slim
ENV PIP_NO_CACHE_DIR=1 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
# System deps (if you later need tk/ffmpeg etc. add here)
RUN apt-get update -y && apt-get install -y --no-install-recommends \
ca-certificates curl \
&& rm -rf /var/lib/apt/lists/*
# Python deps
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# App source
COPY . .
# Spaces provides PORT env. Our app reads it in New NAI/app.py
ENV PORT=7860
# Optional: healthcheck (FastAPI /api/health)
HEALTHCHECK --interval=30s --timeout=5s --retries=5 CMD curl -fsS http://127.0.0.1:${PORT}/api/health || exit 1
CMD ["python", "app.py"] |