vivekvish2004's picture
Upload folder using huggingface_hub
dc97fe1 verified
Raw
History Blame Contribute Delete
2.1 kB
# ============================================================
# OpenEnv Customer Support β€” Production Dockerfile
# ============================================================
# Evaluation Criteria:
# βœ… Runtime correctness β€” clean build, no errors
# βœ… Interface compliance β€” all OpenEnv standard endpoints
# βœ… Task design β€” 7 graded tasks (EASY/MEDIUM/HARD)
# βœ… Grading logic β€” deterministic scores in [0.0, 1.0]
# ============================================================
FROM python:3.10-slim
# ── System dependencies ──────────────────────────────────────
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# ── Non-root user (required by Hugging Face Spaces) ──────────
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PORT=7860
WORKDIR $HOME/app
# ── Python dependencies (cached layer) ───────────────────────
COPY --chown=user backend/requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt
# ── Application source ────────────────────────────────────────
COPY --chown=user . $HOME/app/
# ── Health check (validates runtime correctness) ─────────────
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
CMD curl -f http://localhost:${PORT}/health || exit 1
EXPOSE ${PORT}
# ── Start server ──────────────────────────────────────────────
# Uses uvicorn for production-grade ASGI serving
CMD ["python3", "-m", "uvicorn", "backend.main:app", \
"--host", "0.0.0.0", \
"--port", "7860", \
"--log-level", "info", \
"--workers", "1"]