- Docker installed on your system
- Docker Compose installed
-
Start all services:
docker-compose up --build
-
Start services in background:
docker-compose up -d --build
-
View logs:
docker-compose logs -f app
-
Stop services:
docker-compose down
-
Stop and remove volumes (
⚠️ This will delete all data):docker-compose down -v
- Port: 5432
- Database: centralized_exchange
- Username: postgres
- Password: postgres
- Volume: postgres_data
- Port: 6379
- Volume: redis_data
- Port: 8080
- Health endpoint: http://localhost:8080/health (if available)
- WebSocket: ws://localhost:8080/ws (if available)
The following environment variables are configured in docker-compose.yml:
DATABASE_URL: PostgreSQL connection stringREDIS_URL: Redis connection stringSERVER_ADDRESS: Server binding address (0.0.0.0:8080)JWT_SECRET: JWT signing secret (change in production!)CORS_ORIGIN: Allowed CORS originREDIS_MAX_CONNECTIONS: Redis connection pool sizeREDIS_TIMEOUT_SECONDS: Redis timeoutPRICE_UPDATE_INTERVAL_SECONDS: Price update intervalRUST_LOG: Logging level
For development, you can override environment variables by creating a .env file:
# Example .env file
DATABASE_URL=postgres://postgres:postgres@localhost:5432/centralized_exchange
REDIS_URL=redis://localhost:6379
SERVER_ADDRESS=127.0.0.1:8080
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
CORS_ORIGIN=http://localhost:3000
RUST_LOG=debug- Change default passwords in PostgreSQL service
- Update JWT_SECRET to a secure value
- Configure proper CORS_ORIGIN for your frontend
- Set up proper logging and monitoring
- Use secrets management for sensitive data
- Configure backup strategies for data volumes
-
Database connection issues:
docker-compose logs postgres
-
Redis connection issues:
docker-compose logs redis
-
Application logs:
docker-compose logs app
-
Check service health:
docker-compose ps
-
Rebuild application after code changes:
docker-compose build app docker-compose up app