Spaces:
Running
Running
RateCommons query server: Dockerfile and README
Browse filesBuilds github.com/Harshu-Pande/ratecommons at RC_CODE_REF.
- Dockerfile +27 -0
- README.md +13 -6
Dockerfile
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dockerfile for the Hugging Face Space (Harshu-Pande/ratecommons-api). It builds the query server, and the website,
|
| 2 |
+
# from github.com/Harshu-Pande/ratecommons at RC_CODE_REF (a Space variable: Docker Spaces pass variables as build
|
| 3 |
+
# args). To release: set RC_CODE_REF to the commit and restart the Space with "Factory rebuild".
|
| 4 |
+
FROM node:22-slim AS site
|
| 5 |
+
ARG RC_CODE_REF=main
|
| 6 |
+
WORKDIR /src
|
| 7 |
+
ADD https://codeload.github.com/Harshu-Pande/ratecommons/tar.gz/${RC_CODE_REF} /tmp/src.tgz
|
| 8 |
+
RUN tar xzf /tmp/src.tgz --strip-components=1 && cd carecompass && npm ci --no-audit --no-fund && npm run build
|
| 9 |
+
|
| 10 |
+
FROM python:3.12-slim
|
| 11 |
+
ARG RC_CODE_REF=main
|
| 12 |
+
RUN useradd -m -u 1000 user
|
| 13 |
+
ENV HOME=/home/user PYTHONUNBUFFERED=1 \
|
| 14 |
+
RC_WARM=1 RC_SITE_DIR=/app/site \
|
| 15 |
+
RC_CACHE=/home/user/cache RC_CACHE_GB=30 RC_FILE_MB=4000 \
|
| 16 |
+
RC_SCRATCH=/home/user/scratch RC_TEMP_MAX=8GB RC_SQL_TEMP_MAX=6GB \
|
| 17 |
+
RC_MEMORY=9GB RC_SQL_MEMORY=5GB RC_SLICE_ROWS=20000000 RC_WIDE_ROWS_MAX=150000000 \
|
| 18 |
+
RC_THREADS=2 RC_CONCURRENCY=3 RC_SQL_SECONDS=240 PORT=7860
|
| 19 |
+
WORKDIR /app
|
| 20 |
+
COPY --from=site /src/cloud/api /app/api
|
| 21 |
+
COPY --from=site /src/cloud/server/main.py /src/cloud/server/requirements.txt /app/
|
| 22 |
+
COPY --from=site /src/carecompass/dist /app/site
|
| 23 |
+
RUN pip install --no-cache-dir -r /app/requirements.txt && echo "${RC_CODE_REF}" > /app/REF
|
| 24 |
+
USER user
|
| 25 |
+
RUN mkdir -p /home/user/cache /home/user/scratch
|
| 26 |
+
EXPOSE 7860
|
| 27 |
+
CMD ["sh", "-c", "uvicorn main:app --host 0.0.0.0 --port ${PORT} --workers 1 --timeout-keep-alive 75"]
|
README.md
CHANGED
|
@@ -1,11 +1,18 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
|
|
|
| 7 |
pinned: false
|
| 8 |
-
short_description:
|
| 9 |
---
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: RateCommons API
|
| 3 |
+
emoji: 🩺
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
sdk: docker
|
| 7 |
+
app_port: 7860
|
| 8 |
pinned: false
|
| 9 |
+
short_description: Query server behind ratecommons.org (API and MCP)
|
| 10 |
---
|
| 11 |
|
| 12 |
+
The query server behind [ratecommons.org](https://ratecommons.org): negotiated healthcare prices published under the
|
| 13 |
+
Transparency in Coverage rule, answered from the public data in the `ratecommons` Hugging Face organization.
|
| 14 |
+
|
| 15 |
+
- JSON tools: `POST /api/tool/<name>` (schemas at `GET /api/tools`)
|
| 16 |
+
- MCP (streamable HTTP): `POST /mcp`
|
| 17 |
+
- Source: https://github.com/Harshu-Pande/ratecommons (`cloud/api`, `cloud/server`). This Space builds the commit in the
|
| 18 |
+
`RC_CODE_REF` variable.
|