Overview
The Exness Trading Platform uses Docker Compose to orchestrate 13 services across 4 categories: infrastructure, backend services, data processors, and frontend applications.Service Architecture
Infrastructure Services
These foundational services provide data storage and caching:Complete Service Overview
Infrastructure Layer
Primary database for user accounts, orders, and transactional data.
- Port: 5434 (mapped from 5432)
- Database: exness
- Credentials: postgresql/postgresql
Time-series database for historical market data and candles.
- Port: 5433 (mapped from 5432)
- Database: mydb
- Credentials: myuser/mypassword
In-memory cache for real-time data streams and pub/sub.
- Port: 6379
- Use Cases: Price streams, WebSocket pub/sub, queue management
Document store for account snapshots and backups.
- Port: 27017
- Database: exness_snapshots
- Credentials: admin/admin123
Database Migration
Runs Prisma migrations before application services start.Execution Flow:
- Waits for PostgreSQL to be healthy
- Tests database connectivity
- Runs
bun run db:deployfrom packages/db - Exits successfully
- Triggers dependent services to start
no (runs once per compose up)Core Backend Services
REST API server for trading operations.
- Port: 8000
- Dependencies: PostgreSQL, TimescaleDB, Redis, db-migrate
- Features: Authentication, balance management, trade execution
High-performance order processing engine.
- Dependencies: PostgreSQL, TimescaleDB, Redis, db-migrate
- Features: Sub-millisecond order execution, real-time balance updates
Real-time communication hub for live market data.
- Port: 7070
- Dependencies: Redis
- Protocol: WebSocket with Redis Pub/Sub backend
Handles data persistence and retrieval operations.
- Dependencies: PostgreSQL, Redis, db-migrate
- Features: Transaction logging, order history, user data
Data Processing Services
Fetches real-time market data from Binance WebSocket API.
- Dependencies: Redis
- Features: Live price streaming, bid/ask calculation, spread management
Processes and stores historical market data in TimescaleDB.
- Dependencies: TimescaleDB, Redis
- Features: Candle generation, data compression, retention policies
Creates periodic snapshots of account states.
- Dependencies: MongoDB, Engine
- Features: Account backups, historical state tracking
Frontend Applications
Main trading interface with real-time market data.
- Port: 3001
- Dependencies: Backend, db-migrate
- Features: Trading dashboard, TradingView charts, order management
Platform documentation and API reference.
- Port: 3000
- Framework: Mintlify
Visual database management interface.
- Port: 5555
- Dependencies: PostgreSQL, db-migrate
- Access: http://localhost:5555
Service Dependencies
The platform enforces strict service startup ordering:Network Configuration
All services communicate over a dedicated bridge network:Services reference each other by container name (e.g.,
postgres, redis) within the network. External access uses mapped ports on localhost.Volume Management
Persistent data is stored in named volumes:Environment Variable Injection
Services receive configuration through multiple methods:Health Check Configuration
All infrastructure services include health checks:Common Operations
Starting the Platform
Stopping Services
Viewing Logs
Scaling Services
Only stateless services without port mappings can be scaled. Services like
backend and web with fixed port mappings cannot be scaled without additional configuration.Service Restart Policies
- unless-stopped: Automatically restarts unless manually stopped
- no: Runs once and exits (used for migrations)
Troubleshooting
Service won't start
Service won't start
Check service dependencies and health status:Common issues:
- Dependent service not healthy
- Port already in use
- Missing environment variables
Database connection errors
Database connection errors
Verify database services are healthy:Check connection strings in environment variables.
Migration failures
Migration failures
View migration logs:Manually run migrations:
Out of memory errors
Out of memory errors
Increase Docker resource limits or add memory limits to services:
Production Considerations
Production Checklist
Change all default passwords
Configure volume backups
Enable container resource limits
Set up external monitoring
Configure log aggregation
Enable HTTPS for frontend services
Set up automated health checks
Configure database backups
Next Steps
Environment Variables
Configure all environment variables for your deployment
Database Setup
Learn about database schema and migrations