Quick Start with Docker Compose
The fastest way to get started is using Docker Compose:docker-compose.yml.
Docker Compose Configuration
Thedocker-compose.yml file defines the complete service configuration:
docker-compose.yml
Port Mappings
Spectra Server exposes three ports for different functionalities:Incoming WebSocket Server - Accepts connections from Spectra clients for real-time game data ingestion
REST API Server - Provides status endpoints, preview creation, and team information queries
Outgoing WebSocket Server - Streams processed match data to connected observers and overlays
Volume Mounts
The./keys:/app/keys volume mount is used to persist SSL/TLS certificates:
- Place your
server.keyandserver.crtfiles in the./keysdirectory on the host - The container will use these certificates when
INSECURE=false - If certificates are not provided, they will be auto-generated on container startup
Dockerfile Breakdown
The Spectra Server Dockerfile uses a multi-stage approach optimized for Node.js applications:System Dependencies
Environment Variables
Entrypoint Script
Theentrypoint.sh script handles certificate generation and server startup:
entrypoint.sh
- Checks if SSL certificate and key files exist
- If missing, generates self-signed certificates valid for 10 years
- Starts the server listening on all interfaces (0.0.0.0)
Building the Docker Image
Build the image manually with custom tags:Running the Container
With Environment Variables
With Environment File
Health Checks and Verification
View Container Logs
Extras available on port 5101(or with TLS suffix)- WebSocket server initialization messages
Production Recommendations
SSL/TLS Certificates
SSL/TLS Certificates
- Use certificates from a trusted Certificate Authority (CA)
- Place certificates in a persistent volume mount
- Set appropriate file permissions (600 for private keys)
- Regularly renew certificates before expiration
Resource Limits
Resource Limits
Add resource constraints to prevent resource exhaustion:
docker-compose.yml
Logging Configuration
Logging Configuration
Configure logging drivers for better log management:
docker-compose.yml
Network Configuration
Network Configuration
Use custom networks for better isolation:
docker-compose.yml
Troubleshooting
Container exits immediately
Container exits immediately
Check logs for errors:Common causes:
- Missing environment variables
- Port conflicts with host system
- Invalid certificate paths
Cannot connect to WebSocket servers
Cannot connect to WebSocket servers
- Verify ports are properly exposed:
docker port <container-id> - Check firewall rules on the host system
- Ensure the container is running:
docker ps - Test connectivity:
telnet localhost 5100
SSL certificate errors
SSL certificate errors
- Verify certificate files exist in the mounted volume
- Check file permissions inside the container
- Ensure
SERVER_KEYandSERVER_CERTpaths are correct - For development, set
INSECURE=trueto bypass SSL
Next Steps
Configuration
Configure environment variables and server settings
Local Development
Set up local development environment