Overview
Docker Compose provides the easiest way to deploy OpenSight with all required services. This guide covers both production deployment and development setup.Prerequisites
1
Install Docker
Install Docker Engine 24.0 or later:
2
Install Docker Compose
Docker Compose is included with Docker Desktop. For Linux servers:Expected output:
Docker Compose version v2.20.0 or later3
Clone the repository
Production Deployment
Full Stack Configuration
The productiondocker-compose.yml deploys all services:
docker/docker-compose.yml
Deploy Production Stack
1
Configure environment variables
Create your Edit the See Environment Variables for complete reference.
.env file from the example:.env file with your production settings. At minimum, update:.env
2
Build and start services
3
Run database migrations
After the API container starts, run migrations:
4
Verify deployment
Check that all services are running:All services should show
Up status with healthy checks passing:5
Access the application
Open your browser and navigate to:
- Web UI: http://localhost:3000
- API Docs: http://localhost:4000/api/docs
Development Setup
Development Configuration
For local development, usedocker-compose.dev.yml which runs only PostgreSQL and Redis:
docker/docker-compose.dev.yml
Start Development Environment
1
Start database services
2
Install dependencies
3
Set up database
4
Start development servers
Docker Commands Reference
Production Commands
Development Commands
Service Configuration
Port Mappings
In production, you may want to avoid exposing PostgreSQL and Redis ports to the host. Remove the
ports mapping for these services to keep them internal to the Docker network.Volume Mounts
Health Checks
Each service includes health checks for monitoring:Troubleshooting
Services Won’t Start
Check service logs
Check service logs
Verify environment variables
Verify environment variables
Ensure your
.env file is properly configured:Check port conflicts
Check port conflicts
Ensure ports 3000, 4000, 5432, and 6379 are not in use:
Clean up and restart
Clean up and restart
Stop all services and remove containers:
Database Connection Issues
View Container Resource Usage
Production Best Practices
Use External Database
For production, consider using a managed PostgreSQL service (AWS RDS, Google Cloud SQL, etc.) instead of the containerized database.
Secure Secrets
Use Docker secrets or environment variable management services instead of plain
.env files.Enable HTTPS
Use a reverse proxy like Nginx or Traefik to handle SSL/TLS termination.
Monitor Resources
Set up monitoring with Prometheus, Grafana, or similar tools to track container health.
Remove Exposed Ports
For production security, modifydocker-compose.yml to remove port mappings for internal services:
Set Resource Limits
Add resource constraints to prevent services from consuming excessive resources:Backup and Restore
Backup Database
Restore Database
Backup Volumes
Next Steps
Environment Variables
Configure all environment variables for your deployment
Self-Hosting Guide
Learn about architecture and deployment options