claims-env / Dockerfile
akhiilll's picture
Deploy ClaimSense adjudication gym
1cfeb15 verified
raw
history blame contribute delete
888 Bytes
# ClaimSense — adjudication gym container for Hugging Face Spaces.
# Based on a slim Python image so cold starts stay fast on Spaces hardware.
FROM python:3.11-slim AS runtime
# `curl` powers the HEALTHCHECK below. Everything else is pulled in by pip.
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python dependencies first so subsequent code-only changes
# reuse the cached pip layer.
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
# Copy the rest of the application.
COPY . /app
ENV PYTHONPATH=/app \
PYTHONUNBUFFERED=1
EXPOSE 7860
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -fsS http://localhost:7860/health || exit 1
CMD ["uvicorn", "space_app:app", "--host", "0.0.0.0", "--port", "7860"]