Spaces:
Build error
Build error
Download Dockerfile from ColdHearted/CodeReview: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/spaces/ColdHearted/CodeReview/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/ColdHearted/CodeReview/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/ColdHearted/CodeReview/resolve/main/Dockerfile
1.25 kB
| # ββ Build stage βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| FROM python:3.11-slim AS builder | |
| WORKDIR /app | |
| # Install build dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| gcc \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --prefix=/install -r requirements.txt | |
| # ββ Runtime stage βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| FROM python:3.11-slim | |
| # Hugging Face Spaces expects the app to run as a non-root user | |
| RUN useradd -m -u 1000 appuser | |
| WORKDIR /app | |
| # Copy installed packages | |
| COPY --from=builder /install /usr/local | |
| # Copy application code | |
| COPY --chown=appuser:appuser . . | |
| # Ensure sub-packages are importable | |
| RUN touch tasks/__init__.py graders/__init__.py agents/__init__.py | |
| USER appuser | |
| # HF Spaces expects port 7860 | |
| EXPOSE 7860 | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PYTHONPATH=/app | |
| CMD ["python", "-m", "uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"] | |