Spaces:
Sleeping
Sleeping
File size: 492 Bytes
c5cfc73 664ca6e bc262f3 664ca6e bc262f3 664ca6e c5cfc73 bc262f3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | FROM python:3.10-slim
WORKDIR /app
# Install dependencies first for caching
COPY requirements.txt pyproject.toml ./
COPY server/ server/
COPY __init__.py ./
RUN pip install --no-cache-dir .
# Copy remaining files
COPY . .
EXPOSE 7860
HEALTHCHECK --interval=30s --timeout=3s --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"] |