This document describes the production Docker Compose configuration created for the reverse proxy deployment.
docker-compose.prod.yml- Production Docker Compose configurationDockerfile.frontend- Frontend service Dockerfile for static file generationbackend/Dockerfile- Backend service Dockerfile
nginx/ssl/README.md- SSL certificate setup instructionsnginx/conf.d/ssl.conf.template- SSL configuration template
.env.example- General environment variables template.env.prod.example- Production-specific environment variables
The production setup consists of three services:
-
nginx - Reverse proxy and static file server
- Listens on ports 80 and 443
- Routes
/api/*requests to backend service - Serves frontend static files directly
- Handles WebSocket connections for Socket.io
-
frontend - Static file builder
- Builds React application with production optimizations
- Copies static files to shared volume for nginx
- Uses relative URLs for API calls (same-domain)
-
backend - API server
- Runs Node.js/TypeScript backend on port 6377
- Handles API requests and WebSocket connections
- Manages SQLite database and Redis connections
- Internal
rediscover-networkfor service communication - Only nginx service exposes ports to host
- Backend and frontend services are not directly accessible
rediscover-data- Persistent data storage for backendfrontend-dist- Shared volume for frontend static files
- All services include health check configurations
- Automatic service restart on health check failures
- Proper startup dependencies and timing
- SSL certificate volume mounts configured
- SSL configuration template provided
- HTTP to HTTPS redirect support
Use the development override configuration for local development:
# Start development services with reverse proxy
docker compose -f docker-compose.prod.yml -f docker-compose.dev.yml up -d
# Or use the original development setup (direct services)
docker compose -f docker-compose.dev.yml up -dThe development override (docker-compose.dev.yml) provides:
- Nginx on port 8080 - Test reverse proxy setup locally
- Direct service access - Frontend on 6378, Backend on 6377
- Hot-reloading support - Frontend changes reflected immediately
- Development environment variables - Configured for local testing
This allows developers to:
- Test the reverse proxy configuration locally via
http://localhost:8080 - Access services directly for debugging (frontend: 6378, backend: 6377)
- Maintain existing development workflows with hot-reloading
# Copy and configure environment variables
cp .env.prod.example .env
# Edit .env with your production values
# Set APP_SECRET, FRONTEND_URL, etc.
# Start production services
docker compose -f docker-compose.prod.yml up -d- Place SSL certificates in
nginx/ssl/directory - Copy
nginx/conf.d/ssl.conf.templatetonginx/conf.d/ssl.conf - Update domain name in SSL configuration
- Uncomment SSL server blocks
- Restart nginx service
APP_SECRET- 32-character hex secret for JWT signingFRONTEND_URL- Your production domain URL
JWT_EXPIRES_IN- JWT token expiration (default: 24h)VITE_API_URL- Leave empty for relative URLs (recommended)
- Security headers configured in nginx
- CORS properly configured for production domain
- SSL/TLS ready with modern cipher suites
- Health check endpoints for monitoring
- Proper file permissions and volume mounts
This setup provides a production-ready deployment architecture that eliminates localhost dependencies and enables deployment to custom domains.