Spaces:
Runtime error
Runtime error
Download Dockerfile from DavidRambeau/happytrain: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/DavidRambeau/happytrain/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/DavidRambeau/happytrain/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/DavidRambeau/happytrain/resolve/main/Dockerfile
1.03 kB
| # ββ Stage 1: Builder ββββββββββββββββββββββββββββββββββββββββββ | |
| FROM python:3.12-slim as builder | |
| WORKDIR /app | |
| # Install dependencies | |
| RUN pip install --upgrade pip | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --user -r requirements.txt | |
| # ββ Stage 2: Runtime βββββββββββββββββββββββββββββββββββββββββ | |
| FROM python:3.12-slim | |
| WORKDIR /app | |
| # Copy Python dependencies from builder | |
| COPY --from=builder /root/.local /root/.local | |
| # Copy application code | |
| COPY . . | |
| # Set environment variables | |
| ENV PATH=/root/.local/bin:$PATH \ | |
| PYTHONUNBUFFERED=1 \ | |
| BACKEND_URL=http://backend:7860 | |
| # Expose port | |
| EXPOSE 7860 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=15s \ | |
| CMD python3 -c "import urllib.request; urllib.request.urlopen('http://localhost:7860')" | |
| # Run Flask/Jinja2 application | |
| CMD ["python", "main.py"] |