# 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"]