Download Dockerfile from Akoda35/PyRunner: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/spaces/Akoda35/PyRunner/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Akoda35/PyRunner/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Akoda35/PyRunner/resolve/main/Dockerfile
1.2 kB
| FROM python:3.11-slim | |
| # ========================= | |
| # ENVIRONMENT SETTINGS | |
| # ========================= | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PYTHONPATH=/app | |
| # ========================= | |
| # WORKDIR | |
| # ========================= | |
| WORKDIR /app | |
| # ========================= | |
| # SYSTEM DEPENDENCIES | |
| # ========================= | |
| RUN apt-get update && apt-get install -y \ | |
| curl \ | |
| git \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # ========================= | |
| # PYTHON DEPENDENCIES (CACHED LAYER) | |
| # ========================= | |
| COPY requirements.txt . | |
| RUN pip install --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # ========================= | |
| # COPY SOURCE CODE | |
| # ========================= | |
| COPY . . | |
| # ========================= | |
| # SAFETY CHECK (optional but useful) | |
| # Ensures templates exist at runtime | |
| # ========================= | |
| RUN test -d /app/templates || mkdir -p /app/templates | |
| # ========================= | |
| # PORT | |
| # ========================= | |
| EXPOSE 7860 | |
| # ========================= | |
| # START APPLICATION | |
| # IMPORTANT: MUST MATCH app.py (app = FastAPI()) | |
| # ========================= | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |