candle-annotator/docker-compose.yml
Marko Djordjevic bfe437857b feat: add Python migration script and successfully test SQLite to PostgreSQL data migration
- Created scripts/migrate-sqlite-to-postgres.py as alternative to TypeScript version
- Handles all type conversions: timestamps, booleans, and JSONB fields
- Successfully migrated all 2,836 rows from SQLite to PostgreSQL
- Verified data integrity: all 6 tables migrated correctly
- Charts: 1, Candles: 2,592, Annotations: 4, Span annotations: 223
2026-02-17 14:01:21 +01:00

89 lines
2.1 KiB
YAML

services:
candle-annotator:
build: .
ports:
- "3000:3000"
volumes:
- ml-data:/app/ml-data
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://ml_user:ml_password@postgres:5432/candle_annotator
- INFERENCE_API_URL=http://ml-service:8001
- INFERENCE_API_TIMEOUT=30000
- INFERENCE_BATCH_TIMEOUT=120000
- NEXT_PUBLIC_PREDICTIONS_ENABLED=true
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
ml-service:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
ml-service:
build: ./services/ml
ports:
- "8001:8001"
volumes:
- ml-data:/app/data
- mlflow-data:/app/mlruns
environment:
- MLFLOW_TRACKING_URI=http://mlflow:5000
- DATABASE_URL=postgresql://ml_user:ml_password@postgres:5432/candle_annotator
- PYTHONUNBUFFERED=1
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
mlflow:
condition: service_started
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
mlflow:
image: ghcr.io/mlflow/mlflow:v2.10.0
ports:
- "5000:5000"
volumes:
- mlflow-data:/mlflow
command: >
mlflow server
--backend-store-uri /mlflow
--default-artifact-root /mlflow/artifacts
--host 0.0.0.0
--port 5000
restart: unless-stopped
postgres:
image: postgres:16-alpine
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=ml_user
- POSTGRES_PASSWORD=ml_password
- POSTGRES_DB=candle_annotator
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ml_user -d candle_annotator"]
interval: 10s
timeout: 5s
retries: 5
volumes:
ml-data:
mlflow-data:
postgres-data: