Files
ISSSTELEON/compose.yml
T
Roberto Treviño c84c0eba54
ci / python (push) Failing after 1h11m38s
ci / web (push) Failing after 14m26s
compose: the web app's first administrator, sign-in app registrations and source folders from .env
2026-11-28 13:31:30 -06:00

139 lines
5.4 KiB
YAML

# Every port binds to BIND_ADDRESS (default 127.0.0.1; set it in .env, e.g. a VPN
# address). The API requires no session: whoever reaches that address reads it; the web app
# asks for a sign-in (its first administrator: AUTH_ADMIN_EMAIL and AUTH_ADMIN_PASSWORD).
# Sign-in buttons for OneDrive/SharePoint and Google Drive need the site's app registration:
# MICROSOFT_CLIENT_ID, MICROSOFT_CLIENT_SECRET (MICROSOFT_TENANT_ID), GOOGLE_CLIENT_ID,
# GOOGLE_CLIENT_SECRET. SOURCE_ROOTS lists the server folders sources may browse.
x-python: &python
build: { context: ., target: app }
image: isssteleon-rebuild:dev
volumes: ["./data:/data"]
environment:
DAGSTER_HOST: dagster-webserver
DAGSTER_PORT: "3000"
LLM_URL: ${LLM_URL:-} # any OpenAI-compatible endpoint; empty: extract uses its patterns
LLM_MODEL: ${LLM_MODEL:-qwen3:4b}
MLFLOW_TRACKING_URI: http://mlflow:5000 # the model registry (training, scoring, promotion)
MLFLOW_DISABLE_AGENT_HINT: "1"
AUTH_ADMIN_EMAIL: ${AUTH_ADMIN_EMAIL:-}
AUTH_ADMIN_PASSWORD: ${AUTH_ADMIN_PASSWORD:-}
AUTH_SECRET: ${AUTH_SECRET:-} # empty: one is made and kept in the data folder
SOURCE_ROOTS: ${SOURCE_ROOTS:-}
MICROSOFT_CLIENT_ID: ${MICROSOFT_CLIENT_ID:-}
MICROSOFT_CLIENT_SECRET: ${MICROSOFT_CLIENT_SECRET:-}
MICROSOFT_TENANT_ID: ${MICROSOFT_TENANT_ID:-}
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
restart: unless-stopped
x-sql-server: &sql-server
image: mcr.microsoft.com/mssql/server:2022-CU20-ubuntu-22.04
healthcheck:
test: [CMD-SHELL, '/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P "$$MSSQL_SA_PASSWORD" -Q "select 1" -b']
interval: 5s
retries: 30
x-sql-server-env: &sql-server-env
ACCEPT_EULA: "Y"
MSSQL_PID: Developer
services:
dagster-webserver:
<<: *python
command: >
sh -c "mkdir -p /data/dagster && cp dagster.yaml /data/dagster/ &&
dagster-webserver -h 0.0.0.0 -p 3000 -w workspace.yaml"
ports: ["${BIND_ADDRESS:-127.0.0.1}:${DAGSTER_PORT:-5712}:3000"]
healthcheck: # healthy once the code location has loaded
test:
- CMD
- python
- -c
- >-
import json, urllib.request as u;
q = {"query": "{repositoriesOrError {... on RepositoryConnection {nodes {name}}}}"};
r = u.urlopen(u.Request("http://localhost:3000/graphql", json.dumps(q).encode(),
{"Content-Type": "application/json"}));
assert json.load(r)["data"]["repositoriesOrError"]["nodes"]
interval: 10s
timeout: 60s
retries: 30
dagster-daemon:
<<: *python
command: dagster-daemon run -w workspace.yaml
depends_on: # the webserver loads the code location first (and writes dagster.yaml)
dagster-webserver: { condition: service_healthy }
api:
<<: *python
command: fastapi run WebApi/webapi/main.py --host 0.0.0.0 --port 8000
ports: ["${BIND_ADDRESS:-127.0.0.1}:${API_PORT:-5711}:8000"]
depends_on:
dagster-webserver: { condition: service_healthy }
mlflow:
image: ghcr.io/mlflow/mlflow:v3.18.0
command: >
sh -c "mkdir -p /data/mlflow && exec mlflow server --host 0.0.0.0 --port 5000
--backend-store-uri sqlite:////data/mlflow/mlflow.db
--artifacts-destination /data/mlflow/artifacts
--allowed-hosts 'localhost:*,127.0.0.1:*,mlflow:*,${BIND_ADDRESS:-127.0.0.1}:*'"
volumes: ["./data:/data"]
ports: ["${BIND_ADDRESS:-127.0.0.1}:${MLFLOW_PORT:-5713}:5000"]
restart: unless-stopped
# Optional (`--profile llm`), with LLM_URL=http://llm:11434/v1. Any OpenAI-compatible
# server works instead; without one, extract nodes use their patterns.
llm:
image: ollama/ollama:0.13.5
profiles: [llm]
volumes: ["./data/ollama:/root/.ollama"]
ports: ["${BIND_ADDRESS:-127.0.0.1}:${LLM_PORT:-5714}:11434"]
restart: unless-stopped
web:
build: WebApp
ports: ["${BIND_ADDRESS:-127.0.0.1}:${WEB_PORT:-5710}:80"]
depends_on: [api]
restart: unless-stopped
# A hospital to connect (`--profile site`): SQL Server holding ISSSTELEON's test source
# (Pruebas.dbo.ArchivosUni and ResultadosSubrogados, PDFs of synthetic patients, filled by
# `python -m synthetic.load`). Not published: only the platform's containers reach it.
site-sql:
<<: *sql-server
profiles: [site]
environment: { <<: *sql-server-env, MSSQL_SA_PASSWORD: "${SITE_SQL_PASSWORD:-Synthetic-Site-1}" }
volumes: ["site-sql:/var/opt/mssql"]
restart: unless-stopped
# `docker compose run --rm test`: the whole suite but the pages, on SQLite and PostgreSQL,
# with OCR, the HL7 validator and the SQL Server a site's documents come from.
test:
build: { context: ., target: test }
profiles: [test]
environment:
POSTGRES_TEST_URL: postgresql://postgres:postgres@postgres-test:5432/platform
PGHOST: postgres-test
SITE_SQL_SERVER: mssql+pymssql://sa:Test-only-Site-1@site-sql-test:1433
depends_on:
postgres-test: { condition: service_healthy }
site-sql-test: { condition: service_healthy }
site-sql-test:
<<: *sql-server
profiles: [test]
environment: { <<: *sql-server-env, MSSQL_SA_PASSWORD: Test-only-Site-1 }
postgres-test:
image: postgres:17
profiles: [test]
environment: { POSTGRES_PASSWORD: postgres, POSTGRES_DB: platform }
healthcheck:
test: [CMD, pg_isready]
interval: 2s
retries: 30
volumes:
site-sql: