-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
202 lines (191 loc) · 6.44 KB
/
Copy pathdocker-compose.yml
File metadata and controls
202 lines (191 loc) · 6.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
name: prem-on-fhir
services:
# -------- OLTP Postgres (HAPI backing DB) --------
oltp-db:
build: { context: ./00-setup/oltp-db }
image: oltp-postgres:16
container_name: pof-oltp-db
restart: always
profiles: ["core","all"]
environment:
POSTGRES_DB: ${OLTP_DB_NAME}
POSTGRES_USER: ${OLTP_DB_USER}
POSTGRES_PASSWORD: ${OLTP_DB_PASSWORD}
ports:
- "${OLTP_DB_PORT_HOST}:5432"
volumes:
- pof-pgdata:/var/lib/postgresql/data
shm_size: "${OLTP_SHM_SIZE}"
mem_limit: "${OLTP_MEM_LIMIT}"
mem_reservation: "${OLTP_MEM_RES}"
cpus: "${OLTP_CPUS}"
healthcheck:
test: ["CMD-SHELL","pg_isready -U ${OLTP_DB_USER} -d ${OLTP_DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
# -------- HAPI FHIR --------
hapi-fhir-server:
image: hapiproject/hapi:v8.2.0-2-tomcat
container_name: pof-hapi-fhir-server
restart: always
profiles: ["core","all"]
depends_on:
oltp-db: { condition: service_healthy }
ports:
- "8080:8080"
volumes:
- ./00-setup/hapi-fhir/hapi.application.yaml:/app/config/application.yaml:ro
environment:
SPRING_CONFIG_ADDITIONAL_LOCATION: file:/app/config/
SPRING_DATASOURCE_URL: "jdbc:postgresql://oltp-db:5432/${OLTP_DB_NAME}"
SPRING_DATASOURCE_USERNAME: ${OLTP_DB_USER}
SPRING_DATASOURCE_PASSWORD: ${OLTP_DB_PASSWORD}
SPRING_DATASOURCE_DRIVERCLASSNAME: org.postgresql.Driver
SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT: ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgresDialect
SERVER_TOMCAT_MAX_SWALLOW_SIZE: -1
SERVER_TOMCAT_MAX_HTTP_FORM_POST_SIZE: -1
JAVA_TOOL_OPTIONS: "${HAPI_JAVA_OPTS}"
mem_limit: "${HAPI_MEM_LIMIT}"
mem_reservation: "${HAPI_MEM_RES}"
cpus: "${HAPI_CPUS}"
ulimits:
nofile: 65536
# -------- Analytics Postgres (OLAP) --------
analytics-db:
build: { context: ./00-setup/analytics-db }
image: analytics-postgres:16
container_name: pof-analytics-db
restart: always
profiles: ["analytics","core", "dashboard", "all"]
environment:
POSTGRES_DB: ${AN_DB_NAME}
POSTGRES_USER: ${AN_DB_USER}
POSTGRES_PASSWORD: ${AN_DB_PASSWORD}
MB_DB_NAME: ${MB_DB_NAME:-metabase}
MB_DB_USER: ${MB_DB_USER:-metabase_app}
MB_DB_PASS: ${MB_DB_PASS:-change_me_strong}
ports:
- "${AN_DB_PORT}:5432"
command: ["postgres","-c","config_file=/etc/postgresql/postgresql.analytics.conf"]
volumes:
- analytics-pgdata:/var/lib/postgresql/data
- ./00-setup/analytics-db/init:/docker-entrypoint-initdb.d
shm_size: "${AN_SHM_SIZE}"
mem_limit: "${AN_MEM_LIMIT}"
mem_reservation: "${AN_MEM_RES}"
cpus: "${AN_CPUS}"
healthcheck:
test: ["CMD-SHELL","pg_isready -U ${AN_DB_USER} -d ${AN_DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
# -------- pgAdmin --------
pgadmin:
image: dpage/pgadmin4:8
container_name: pof-pgadmin
restart: always
profiles: ["core","all"]
depends_on:
oltp-db: { condition: service_healthy }
analytics-db: { condition: service_healthy }
ports:
- "5050:80"
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
volumes:
- pof-pgadmin:/var/lib/pgadmin
- ./00-setup/pgadmin/servers.json:/pgadmin4/servers.json:ro
mem_limit: "${PGADMIN_MEM_LIMIT}"
cpus: "${PGADMIN_CPUS}"
# -------- Static web server for Synthea files --------
synthea-files:
image: nginx:alpine
container_name: pof-synthea-files
restart: always
profiles: ["core","all"]
volumes:
- ${SYNTHEA_OUT_DIR}:/usr/share/nginx/html:ro
- ./00-setup/synthea-files/conf/nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- "${SYNTHEA_HTTP_PORT}:80"
# -------- dbt runner (optional, dev helper) --------
dbt-run:
build:
context: ./02-elt/fhir_prem_to_decision
dockerfile: Dockerfile
image: pof-dbt:1.10.10
container_name: pof-dbt
profiles: ["analytics","all"]
environment:
AN_DB_HOST: analytics-db
AN_DB_PORT: "5432"
DBT_USER: ${DBT_USER}
DBT_PASSWORD: ${DBT_PASSWORD}
DBT_PROFILES_DIR: /usr/app
working_dir: /usr/app
volumes:
- ./02-elt/fhir_prem_to_decision:/usr/app
depends_on:
analytics-db: { condition: service_healthy }
ports:
- "8081:8081"
# -------- NLP one-shot container --------
nlp:
build:
context: ./02-elt/nlp_pipeline
image: pof-nlp:latest
container_name: pof-nlp
profiles: ["analytics", "nlp","all"]
environment:
PG_HOST: analytics-db
PG_PORT: "5432"
PG_DB: ${PG_DB}
PG_USER: ${PG_USER}
PG_PASSWORD: ${PG_PASSWORD}
PG_SCHEMA: ${PG_SCHEMA}
volumes:
- nlp-hfcache:/app/.hf_cache
depends_on:
analytics-db: { condition: service_healthy }
entrypoint: ["python","-m","pipeline.cli"]
command: ["--help"]
# Optional local resource caps for NLP runs (CPU/GPU depends on your base image)
# mem_limit: "6g"
# cpus: "2.0"
metabase:
image: metabase/metabase:latest # or pin a version you prefer
container_name: pof-metabase
restart: always
profiles: ["analytics","all","dashboard"]
depends_on:
analytics-db: { condition: service_healthy }
ports:
- "3000:3000" # change host port if 3000 is busy
environment:
# Metabase application DB (stores users, dashboards, settings)
MB_DB_TYPE: postgres
MB_DB_HOST: analytics-db
MB_DB_PORT: "5432"
MB_DB_DBNAME: ${MB_DB_NAME:-metabase}
MB_DB_USER: ${MB_DB_USER:-metabase_app}
MB_DB_PASS: ${MB_DB_PASS:-change_me_strong}
# Nice-to-haves
MB_JETTY_PORT: "3000"
MB_SITE_URL: "http://localhost:3000"
JAVA_TOOL_OPTIONS: "-Xms512m -Xmx1024m" # adjust for your RAM
# Optional: mount a plugins folder if you’ll add drivers later
volumes:
- metabase-plugins:/plugins
healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://localhost:3000/api/health"]
interval: 10s
timeout: 5s
retries: 10
volumes:
pof-pgdata:
pof-pgadmin:
analytics-pgdata:
nlp-hfcache:
metabase-plugins: