hyperlinken/ALT_DESIGN
0
1# ─────────────────────────────────────────────────────────────────────────────2# IT Helpdesk Triage OpenEnv — Dockerfile3# Builds a lean production image that starts the FastAPI server on port 7860.4# Compatible with Hugging Face Spaces (Docker SDK).5# ─────────────────────────────────────────────────────────────────────────────6 7FROM python:3.11-slim8 9LABEL description="IT Helpdesk Triage & Incident Management — OpenEnv RL Environment"10LABEL version="1.0.0"11 12# Prevent .pyc files and enable unbuffered stdout/stderr13ENV PYTHONDONTWRITEBYTECODE=114ENV PYTHONUNBUFFERED=115 16# Create a non-root user for security17RUN addgroup --system appgroup && adduser --system --ingroup appgroup appuser18 19WORKDIR /app20 21# Install dependencies first (better layer caching)22COPY requirements.txt .23RUN pip install --no-cache-dir --upgrade pip \24 && pip install --no-cache-dir -r requirements.txt25 26# Copy application source27COPY models.py environment.py app.py client.py inference.py openenv.yaml ./28 29# Transfer ownership to non-root user30RUN chown -R appuser:appgroup /app31USER appuser32 33# Expose the port Hugging Face Spaces expects34EXPOSE 786035 36# Health check so HF Space knows when the container is ready37HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \38 CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/')"39 40# Launch the server41CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", \42 "--workers", "1", "--log-level", "info"]43 