-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
197 lines (187 loc) · 6.2 KB
/
Copy pathdocker-compose.yml
File metadata and controls
197 lines (187 loc) · 6.2 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
# =============================================================================
# docker-compose.yml — Fintel Platform
# =============================================================================
# Phase 1 services (active): postgres, pipeline, notebook
# Phase 2 services (active): chromadb, neo4j
# Phase 3+ services (commented): redis, mlflow, api, frontend
networks:
fintel_net:
driver: bridge
volumes:
postgres_data:
labels_data:
outputs_data:
logs_data:
notebook_work:
huggingface_cache:
chroma_data:
neo4j_data:
neo4j_logs:
services:
# ── PostgreSQL ──────────────────────────────────────────────────────────────
postgres:
image: postgres:16-alpine
container_name: fintel_postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./db/init:/docker-entrypoint-initdb.d
ports:
- "5432:5432"
networks:
- fintel_net
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
# ── ChromaDB (vector store for RAG) ─────────────────────────────────────────
chromadb:
image: chromadb/chroma:latest
container_name: fintel_chromadb
restart: unless-stopped
volumes:
- chroma_data:/chroma/chroma
ports:
- "8000:8000"
networks:
- fintel_net
# ── Neo4j (knowledge graph) ──────────────────────────────────────────────────
neo4j:
image: neo4j:5.18-community
container_name: fintel_neo4j
restart: unless-stopped
environment:
NEO4J_AUTH: neo4j/${NEO4J_PASSWORD}
NEO4J_PLUGINS: '["apoc"]'
NEO4J_dbms_security_procedures_unrestricted: apoc.*
NEO4J_dbms_memory_heap_initial__size: 512m
NEO4J_dbms_memory_heap_max__size: 1G
NEO4J_dbms_memory_pagecache_size: 512m
volumes:
- neo4j_data:/data
- neo4j_logs:/logs
ports:
- "7474:7474" # Neo4j Browser UI
- "7687:7687" # Bolt protocol (driver connection)
networks:
- fintel_net
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:7474 || exit 1"]
interval: 15s
timeout: 10s
retries: 10
# ── Pipeline ─────────────────────────────────────────────────────────────────
pipeline:
build:
context: .
dockerfile: Dockerfile
target: runtime
container_name: fintel_pipeline
restart: "no"
env_file: .env
environment:
POSTGRES_HOST: postgres
CHROMA_HOST: chromadb
NEO4J_HOST: neo4j
NEO4J_PORT: 7687
TRANSFORMERS_CACHE: /cache/huggingface
PYTHONUNBUFFERED: "1"
volumes:
- ./data/raw:/app/data/raw
- ./data/processed:/app/data/processed
- ./data/chunks:/app/data/chunks
- ./data/clusters:/app/data/clusters
- ./data/extracted:/app/data/extracted
- labels_data:/app/data/labels
- outputs_data:/app/outputs
- logs_data:/app/logs
- huggingface_cache:/cache/huggingface
- ./src:/app/src
- ./config.py:/app/config.py
- ./run_phase1.py:/app/run_phase1.py
- ./run_phase2.py:/app/run_phase2.py
networks:
- fintel_net
depends_on:
postgres:
condition: service_healthy
chromadb:
condition: service_started
neo4j:
condition: service_healthy
# ── Jupyter Notebook ──────────────────────────────────────────────────────
notebook:
build:
context: .
dockerfile: Dockerfile
target: runtime
container_name: fintel_notebook
restart: unless-stopped
env_file: .env
environment:
POSTGRES_HOST: postgres
CHROMA_HOST: chromadb
NEO4J_HOST: neo4j
NEO4J_PORT: 7687
TRANSFORMERS_CACHE: /cache/huggingface
PYTHONUNBUFFERED: "1"
volumes:
- ./data/raw:/app/data/raw
- ./data/processed:/app/data/processed
- ./data/chunks:/app/data/chunks
- ./data/clusters:/app/data/clusters
- ./data/extracted:/app/data/extracted
- labels_data:/app/data/labels
- outputs_data:/app/outputs
- logs_data:/app/logs
- notebook_work:/app/notebooks
- huggingface_cache:/cache/huggingface
- ./src:/app/src
- ./config.py:/app/config.py
command: >
jupyter notebook
--ip=0.0.0.0
--port=8888
--no-browser
--NotebookApp.token=${JUPYTER_TOKEN}
--notebook-dir=/app/notebooks
ports:
- "8888:8888"
networks:
- fintel_net
depends_on:
postgres:
condition: service_healthy
neo4j:
condition: service_healthy
# ── Redis (Phase 3: job queue) ────────────────────────────────────────────
# redis:
# image: redis:7-alpine
# container_name: fintel_redis
# restart: unless-stopped
# ports:
# - "6379:6379"
# networks:
# - fintel_net
# ── MLflow (Phase 3: experiment tracking) ────────────────────────────────
# mlflow:
# image: ghcr.io/mlflow/mlflow:v2.12.1
# container_name: fintel_mlflow
# restart: unless-stopped
# command: >
# mlflow server
# --backend-store-uri postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres/${POSTGRES_DB}
# --default-artifact-root /mlflow/artifacts
# --host 0.0.0.0 --port 5000
# ports:
# - "5000:5000"
# networks:
# - fintel_net
# depends_on:
# postgres:
# condition: service_healthy