Spaces:
Runtime error
Runtime error
Download Dockerfile from IDKHowToCodeFr/tinyml-backend: direct link, hf CLI and curl.
- Browser
- Download file 720 Bytes
-
https://huggingface.co/spaces/IDKHowToCodeFr/tinyml-backend/resolve/c9f71bcbf36b46973a67a10c207201a3fa78267d/Dockerfile
- Command line
-
hf download hf://spaces/IDKHowToCodeFr/tinyml-backend@c9f71bcbf36b46973a67a10c207201a3fa78267d/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/IDKHowToCodeFr/tinyml-backend/resolve/c9f71bcbf36b46973a67a10c207201a3fa78267d/Dockerfile
720 Bytes
| FROM python:3.12-slim | |
| WORKDIR /app | |
| # Install system dependencies if required by any ML libraries | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install python dependencies from the backend | |
| COPY backend/requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy all necessary files and directories | |
| COPY . . | |
| # Hugging Face Spaces mandates port 7860; can be overridden via PORT env var | |
| EXPOSE 7860 | |
| EXPOSE 8000 | |
| # Ensure Python knows where to find the backend module | |
| ENV PYTHONPATH=/app | |
| # Start the FastAPI server with dynamic port support | |
| CMD ["sh", "-c", "uvicorn backend.main:app --host 0.0.0.0 --port ${PORT:-7860}"] | |