Maintainer contact: support@larucare.com
Works on Windows, macOS, and Linux with Docker Desktop / Engine. Requires Docker Compose v2.24+ (for publish overlay !reset).
git clone https://github.com/ranasl62/ehr-chronic-disease-risk-prediction.git
cd ehr-chronic-disease-risk-prediction
docker compose up --build
# equivalent: make researcher-up
# background: make researcher-up-dImages are published to Docker Hub by the publish-images workflow (main / v* tags). Repos are Public.
docker pull ranasl62/ehr-risk-api:latest
docker pull ranasl62/ehr-risk-web:latest
git clone https://github.com/ranasl62/ehr-chronic-disease-risk-prediction.git
cd ehr-chronic-disease-risk-prediction
docker compose -f docker-compose.yml -f docker-compose.publish.yml pull
docker compose -f docker-compose.yml -f docker-compose.publish.yml up
# equivalent: make researcher-up-pull| Image | Docker Hub ref |
|---|---|
| API | ranasl62/ehr-risk-api:latest (also :sha-…, :v…) — hub |
| Web | ranasl62/ehr-risk-web:latest — hub |
Site page: docs/docker-images/.
Pin or override in .env: IMAGE_API=… · IMAGE_WEB=… (see .env.example).
| Service | Host port | Local image | Notes |
|---|---|---|---|
web |
8080 | ehr-risk-web:local |
Angular + nginx; proxies /v1 → API |
api |
8000 | ehr-risk-api:local |
FastAPI; OpenAPI at /docs |
prepare |
— | same as API | One-shot: trains model.pkl if missing |
Open http://127.0.0.1:8080 → Datasets → Train → Results → Predict.
Persistence: the repo directory is mounted into api / prepare, so data/, reports/, uploads, and model.pkl survive docker compose down. You still need a clone (or a directory with the same layout) even when pulling images.
Optional API key: set API_KEY in .env; send header X-API-Key (UI Config or curl).
Stop / clean
docker compose down # stop containers (keeps images + host data)
docker compose down --rmi local # also remove project images
# Host artifacts (optional): rm -f model.pkl; rm -rf reports/runs data/uploads/*| Goal | Command |
|---|---|
| Pull published then up | make researcher-up-pull |
| Force retrain then up | FORCE_TRAIN=1 docker compose up --build |
| Train only | docker compose --profile train run --rm train |
| API only | docker compose up --no-deps api |
| Custom ports | UI_PORT=9080 API_PORT=9000 docker compose up --build |
| Logs | make researcher-logs |
| Optional API key / GPU | cp .env.example .env and/or cp docker-compose.override.example.yml docker-compose.override.yml |
- Create a Docker Hub access token with write (hub.docker.com → Account Settings → Security).
- In the GitHub repo: Settings → Secrets and variables → Actions, add:
DOCKERHUB_USERNAME— Docker Hub username (e.g.ranasl62)DOCKERHUB_TOKEN— the access token (never commit this)
- Optionally create public repos
ehr-risk-apiandehr-risk-webunder that Hub user (or let the first push auto-create them, then set Public). - Push to
mainor tagv*(or run Publish Docker images via Actions → workflow_dispatch). - Confirm:
docker pull ranasl62/ehr-risk-api:latestanddocker pull ranasl62/ehr-risk-web:latest. - Confirm each Hub repo Overview shows the synced README (
deployment/dockerhub/ehr-risk-api.md/ehr-risk-web.md). The access token needs Read / Write / Delete for description sync.
Why two images (not one mega-image)? Keeps the research workbench architecture clear (FastAPI + nginx Angular), faster rebuilds when only UI or only API changes, and matches local npm start + uvicorn development.
Note: Older docs referenced
ghcr.io/ranasl62/…. Those GHCR packages were never published (or not public), which is why pulls returned 404. Use Docker Hub refs above.
Requires Python 3.10+ and Node 20+ for the UI.
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
python -m pip install -U pip setuptools wheel
pip install -r requirements.txt
pip install -e .
ehr-ai init
# terminal 1
PYTHONPATH=. uvicorn api.main:app --reload --port 8000
# terminal 2
cd web && npm install && npm start
# http://127.0.0.1:4200 (proxies /v1 to API)sudo apt install -y python3-venv python3-full python3-pip
rm -rf .venv && python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
pip install -r requirements.txt && pip install -e .Or use uv: uv venv .venv && uv pip install -r requirements.txt && uv pip install -e .
ehr-ai init
ehr-ai doctor
ehr-ai train --task diabetes
ehr-ai compare --task diabetes
ehr-ai evaluate
ehr-ai explain
ehr-ai report
ehr-ai startPYTHONPATH=. python -m training.train \
--format longitudinal --data data/demo/ehr_data.csv \
--model logreg --split-by-patientCopy .env.example → .env (never commit secrets):
API_KEY— optional; when set, sendX-API-Key(UI Config or curl)UI_PORT/API_PORT— host ports (default 8080 / 8000)IMAGE_API/IMAGE_WEB— image refs (defaults: local tags; Docker Hub withdocker-compose.publish.yml)API_ENDPOINT— optional; bake absolute API base into the web image/build (leave empty for same-origin/v1). Hosted example:https://ehr-api.larucare.comCORS_ORIGINS— optional; comma-separated browser origins for the API (apiservice /docker run -e/ host env). Empty → local:8080/:4200. For the hosted UI setCORS_ORIGINS=https://ehr-risk-framework.larucare.comwhen the SPA uses a remoteAPI_ENDPOINTMODEL_PATH— artifact path (defaultmodel.pkl)FORCE_TRAIN—1to retrain on every Compose up
Optional Compose merge file: docker-compose.override.example.yml.
PhysioNet credentialing required for real extracts. Demo/synthetic CSVs need none.
See docs/mimic_lock_checklist.md.
Email support@larucare.com, or open a GitHub issue.
More: docs/HOW_IT_HELPS.md · docs/researcher_quickstart.md.