267 lines
8.0 KiB
YAML
267 lines
8.0 KiB
YAML
version: '3.8'
|
|
|
|
# =============================================================================
|
|
# ORBIQUANT IA TRADING PLATFORM - Docker Compose Configuration
|
|
# =============================================================================
|
|
# Este archivo define todos los servicios del proyecto para desarrollo
|
|
# Fecha: 2025-12-05
|
|
# =============================================================================
|
|
|
|
services:
|
|
# ===========================================================================
|
|
# INFRASTRUCTURE SERVICES
|
|
# ===========================================================================
|
|
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
container_name: orbiquant-postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: orbiquant_trading
|
|
POSTGRES_USER: orbiquant_user
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-orbiquant_dev_2025}
|
|
POSTGRES_INITDB_ARGS: "-E UTF8"
|
|
ports:
|
|
- "${POSTGRES_PORT:-5432}:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./apps/database/schemas:/docker-entrypoint-initdb.d:ro
|
|
networks:
|
|
- orbiquant-network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U orbiquant_user -d orbiquant_trading"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: orbiquant-redis
|
|
restart: unless-stopped
|
|
command: redis-server --appendonly yes
|
|
ports:
|
|
- "${REDIS_PORT:-6379}:6379"
|
|
volumes:
|
|
- redis_data:/data
|
|
networks:
|
|
- orbiquant-network
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# ===========================================================================
|
|
# BACKEND SERVICES
|
|
# ===========================================================================
|
|
|
|
backend:
|
|
build:
|
|
context: ./apps/backend
|
|
dockerfile: Dockerfile
|
|
container_name: orbiquant-backend
|
|
restart: unless-stopped
|
|
environment:
|
|
NODE_ENV: ${NODE_ENV:-development}
|
|
PORT: ${BACKEND_API_PORT:-3081}
|
|
DB_HOST: postgres
|
|
DB_PORT: 5432
|
|
DB_NAME: orbiquant_trading
|
|
DB_USER: orbiquant_user
|
|
DB_PASSWORD: ${POSTGRES_PASSWORD:-orbiquant_dev_2025}
|
|
REDIS_HOST: redis
|
|
REDIS_PORT: 6379
|
|
ML_ENGINE_URL: http://ml-engine:3083
|
|
FRONTEND_URL: http://localhost:${FRONTEND_WEB_PORT:-3080}
|
|
JWT_ACCESS_SECRET: ${JWT_ACCESS_SECRET}
|
|
JWT_REFRESH_SECRET: ${JWT_REFRESH_SECRET}
|
|
STRIPE_SECRET_KEY: ${STRIPE_SECRET_KEY}
|
|
ports:
|
|
- "${BACKEND_API_PORT:-3081}:3081"
|
|
- "${BACKEND_WS_PORT:-3082}:3082"
|
|
volumes:
|
|
- ./apps/backend/src:/app/src
|
|
- backend_node_modules:/app/node_modules
|
|
networks:
|
|
- orbiquant-network
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
command: npm run dev
|
|
|
|
# ===========================================================================
|
|
# FRONTEND SERVICES
|
|
# ===========================================================================
|
|
|
|
frontend:
|
|
build:
|
|
context: ./apps/frontend
|
|
dockerfile: Dockerfile
|
|
container_name: orbiquant-frontend
|
|
restart: unless-stopped
|
|
environment:
|
|
VITE_API_URL: http://localhost:${BACKEND_API_PORT:-3081}/api/v1
|
|
VITE_WS_URL: ws://localhost:${BACKEND_WS_PORT:-3082}
|
|
VITE_STRIPE_PUBLISHABLE_KEY: ${STRIPE_PUBLISHABLE_KEY}
|
|
ports:
|
|
- "${FRONTEND_WEB_PORT:-3080}:3080"
|
|
volumes:
|
|
- ./apps/frontend/src:/app/src
|
|
- ./apps/frontend/public:/app/public
|
|
- frontend_node_modules:/app/node_modules
|
|
networks:
|
|
- orbiquant-network
|
|
depends_on:
|
|
- backend
|
|
command: npm run dev -- --host 0.0.0.0 --port 3080
|
|
|
|
# ===========================================================================
|
|
# PYTHON SERVICES
|
|
# ===========================================================================
|
|
|
|
ml-engine:
|
|
build:
|
|
context: ./apps/ml-engine
|
|
dockerfile: Dockerfile
|
|
container_name: orbiquant-ml-engine
|
|
restart: unless-stopped
|
|
environment:
|
|
PYTHONUNBUFFERED: 1
|
|
DB_HOST: postgres
|
|
DB_PORT: 5432
|
|
DB_NAME: orbiquant_trading
|
|
DB_USER: orbiquant_user
|
|
DB_PASSWORD: ${POSTGRES_PASSWORD:-orbiquant_dev_2025}
|
|
REDIS_HOST: redis
|
|
REDIS_PORT: 6379
|
|
PORT: ${ML_ENGINE_PORT:-3083}
|
|
LOG_LEVEL: INFO
|
|
ports:
|
|
- "${ML_ENGINE_PORT:-3083}:3083"
|
|
volumes:
|
|
- ./apps/ml-engine/src:/app/src
|
|
- ./apps/ml-engine/models:/app/models
|
|
- ml_models:/app/trained_models
|
|
networks:
|
|
- orbiquant-network
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
command: uvicorn src.api.main:app --host 0.0.0.0 --port 3083 --reload
|
|
|
|
data-service:
|
|
build:
|
|
context: ./apps/data-service
|
|
dockerfile: Dockerfile
|
|
container_name: orbiquant-data-service
|
|
restart: unless-stopped
|
|
environment:
|
|
PYTHONUNBUFFERED: 1
|
|
DB_HOST: postgres
|
|
DB_PORT: 5432
|
|
DB_NAME: orbiquant_trading
|
|
DB_USER: orbiquant_user
|
|
DB_PASSWORD: ${POSTGRES_PASSWORD:-orbiquant_dev_2025}
|
|
POLYGON_API_KEY: ${POLYGON_API_KEY}
|
|
METAAPI_TOKEN: ${METAAPI_TOKEN}
|
|
METAAPI_ACCOUNT_ID: ${METAAPI_ACCOUNT_ID}
|
|
SYNC_INTERVAL_MINUTES: 5
|
|
LOG_LEVEL: INFO
|
|
PORT: ${DATA_SERVICE_PORT:-3084}
|
|
ports:
|
|
- "${DATA_SERVICE_PORT:-3084}:3084"
|
|
volumes:
|
|
- ./apps/data-service/src:/app/src
|
|
networks:
|
|
- orbiquant-network
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
command: python -m src.main
|
|
|
|
# ===========================================================================
|
|
# DEVELOPMENT TOOLS (Optional)
|
|
# ===========================================================================
|
|
|
|
pgadmin:
|
|
image: dpage/pgadmin4:latest
|
|
container_name: orbiquant-pgadmin
|
|
restart: unless-stopped
|
|
environment:
|
|
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL:-admin@orbiquant.io}
|
|
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD:-admin}
|
|
PGADMIN_CONFIG_SERVER_MODE: 'False'
|
|
ports:
|
|
- "${PGADMIN_PORT:-5050}:80"
|
|
volumes:
|
|
- pgadmin_data:/var/lib/pgadmin
|
|
networks:
|
|
- orbiquant-network
|
|
depends_on:
|
|
- postgres
|
|
profiles:
|
|
- dev-tools
|
|
|
|
mailhog:
|
|
image: mailhog/mailhog:latest
|
|
container_name: orbiquant-mailhog
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${MAILHOG_SMTP_PORT:-1025}:1025" # SMTP
|
|
- "${MAILHOG_WEB_PORT:-8025}:8025" # Web UI
|
|
networks:
|
|
- orbiquant-network
|
|
profiles:
|
|
- dev-tools
|
|
|
|
# =============================================================================
|
|
# VOLUMES
|
|
# =============================================================================
|
|
volumes:
|
|
postgres_data:
|
|
driver: local
|
|
redis_data:
|
|
driver: local
|
|
backend_node_modules:
|
|
driver: local
|
|
frontend_node_modules:
|
|
driver: local
|
|
ml_models:
|
|
driver: local
|
|
pgadmin_data:
|
|
driver: local
|
|
|
|
# =============================================================================
|
|
# NETWORKS
|
|
# =============================================================================
|
|
networks:
|
|
orbiquant-network:
|
|
driver: bridge
|
|
name: orbiquant-network
|
|
|
|
# =============================================================================
|
|
# USAGE INSTRUCTIONS
|
|
# =============================================================================
|
|
# Start all services:
|
|
# docker-compose up -d
|
|
#
|
|
# Start with development tools:
|
|
# docker-compose --profile dev-tools up -d
|
|
#
|
|
# View logs:
|
|
# docker-compose logs -f [service-name]
|
|
#
|
|
# Stop all services:
|
|
# docker-compose down
|
|
#
|
|
# Reset everything (including volumes):
|
|
# docker-compose down -v
|
|
#
|
|
# Rebuild a service:
|
|
# docker-compose up -d --build [service-name]
|
|
# =============================================================================
|