Spaces:
Running
Running
| FROM public.ecr.aws/docker/library/python:3.11-slim | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 | |
| WORKDIR /app | |
| COPY . . | |
| RUN apt-get update && apt-get install -y --no-install-recommends git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN python -m pip install --upgrade pip \ | |
| && python -m pip install --no-cache-dir -r requirements.txt \ | |
| && python -m pip install --no-cache-dir . | |
| RUN useradd --create-home --uid 10001 appuser \ | |
| && chown -R appuser:appuser /app | |
| EXPOSE 7860 | |
| HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \ | |
| CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:7860/health', timeout=3)" | |
| USER appuser | |
| CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"] | |