# ============================================================ # 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"]