Spaces:
Runtime error
Runtime error
| ARG BASE_IMAGE=python:3.11-slim | |
| FROM ${BASE_IMAGE} AS builder | |
| WORKDIR /app | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| PYTHONPATH=/app | |
| RUN apt-get update && apt-get install -y --no-install-recommends gcc \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN pip install --upgrade pip | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --timeout=300 --retries=5 -r requirements.txt | |
| COPY . . | |
| EXPOSE 7860 | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ | |
| CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health')" || exit 1 | |
| CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"] | |