CoolFace
Apppublic

dprajjwal/supportops-env

sourceHugging Facebsd-3-clauseupdated 6mo agoView on Hugging Face
0likes
Dockerfile49 linesDownload Raw Back to root
1# ─────────────────────────────────────────────────────────2# SupportOps-Env Dockerfile3# Multi-stage build using python:3.11-slim4# ─────────────────────────────────────────────────────────5FROM python:3.11-slim AS builder6 7WORKDIR /app8 9# Install build dependencies10RUN apt-get update && apt-get install -y --no-install-recommends \11    gcc \12    && rm -rf /var/lib/apt/lists/*13 14# Copy requirements first for Docker layer caching15COPY server/requirements.txt ./requirements.txt16 17# Install Python dependencies18RUN pip install --no-cache-dir --upgrade pip && \19    pip install --no-cache-dir -r requirements.txt20 21# ─────────────────────────────────────────────────────────22FROM python:3.11-slim AS runtime23 24WORKDIR /app25 26# Copy installed packages from builder27COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages28COPY --from=builder /usr/local/bin /usr/local/bin29 30# Copy application code31COPY models.py ./models.py32COPY server/ ./server/33COPY openenv.yaml ./openenv.yaml34COPY inference.py ./inference.py35COPY client.py ./client.py36 37# Set Python path so imports work correctly38ENV PYTHONPATH="/app"39 40# Expose server port41EXPOSE 800042 43# Health check44HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \45    CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')" || exit 146 47# Run the FastAPI server48CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]49