This directory contains the production deployment configuration for OIDC VPN Manager using Docker Compose with PostgreSQL databases and proper security configurations.
This deployment uses the Combined/Unsplit Frontend Service which provides:
- User interface for certificate generation and management
- Administrative interface for PSK and certificate management
- API endpoints for both user and server operations
- All functionality in a single service instance
The production deployment includes:
- Frontend Service: User-facing web application with OpenVPN profile generation
- Signing Service: Certificate signing service (isolated from frontend)
- Certificate Transparency Service: Audit log for all issued certificates
- PostgreSQL Databases: Separate databases for each service
- Nginx Reverse Proxy: SSL termination and load balancing
- Docker and Docker Compose
- OpenSSL (for secret generation)
- Valid SSL certificates for your domain
- OIDC provider configuration
- PKI materials (CA certificates and keys)
-
Generate secrets:
./generate-secrets.sh
-
Configure environment:
- Update
.env.*files with your actual values - Replace
your-oidc-provider.comandvpn.yourdomain.com - Update OIDC client ID and other provider-specific settings
- Update
-
Prepare PKI materials:
mkdir -p pki ssl # Copy your CA certificates to pki/ # Copy SSL certificates to ssl/
-
Configuration files included: The following configuration files are already included:
openvpn_templates/- OpenVPN client configuration templatesserver_templates/- OpenVPN server configuration templatesopenvpn_options.yaml- Client configuration optionspki/- Sample PKI certificates (replace with your own)
-
Deploy:
docker-compose up -d
deploy/docker/
├── docker-compose.yml # Main deployment configuration
├── .env.frontend # Frontend service environment
├── .env.certtransparency # CT service environment
├── .env.signing # Signing service environment
├── nginx.conf # Nginx reverse proxy configuration
├── generate-secrets.sh # Secret generation script
├── secrets/ # Generated secrets (create with script)
├── pki/ # PKI materials (copy from tests/)
├── ssl/ # SSL certificates for nginx
├── openvpn_templates/ # OpenVPN configuration templates
└── openvpn_options.yaml # OpenVPN options configuration
- Separate networks for frontend, backend, and database tiers
- Services only communicate through defined network interfaces
- All sensitive values stored in Docker secrets
- No plaintext secrets in environment variables
- Secure file permissions (600) on secret files
- Modern TLS configuration (TLS 1.2/1.3 only)
- Strong cipher suites and security headers
- HSTS and other security headers enabled
- Separate PostgreSQL instances for each service
- Password authentication via Docker secrets
- Isolated database networks
- Production environment configuration
- CSRF protection enabled
- Secure session cookie settings
- Rate limiting on authentication and API endpoints
All services include health checks:
- Database connectivity verification
- Application endpoint monitoring
- Dependency validation
- Automatic restart on failure
Health check endpoints are available:
- Frontend:
https://yourdomain.com/health - Services expose internal health endpoints for monitoring
- Generate new secrets with
./generate-secrets.sh - Update the affected services:
docker-compose up -d <service> - Services will restart with new secrets automatically
Migrations run automatically during deployment via dedicated migration containers.
- Database volumes are persistent and should be backed up regularly
- PKI materials should be backed up securely
- Secret files should be backed up to encrypted storage
Update these in the respective .env.* files:
OIDC_DISCOVERY_URL: Your OIDC provider's discovery endpointOIDC_CLIENT_ID: Client ID from your OIDC providerFRONTEND_SERVICE_URL: Your public-facing URL
Place your SSL certificates in the ssl/ directory:
ssl/server.crt: SSL certificatessl/server.key: SSL private key
Copy PKI materials to the pki/ directory:
pki/root-ca.crt: Root CA certificatepki/intermediate-ca.crt: Intermediate CA certificatepki/intermediate-ca.key: Intermediate CA private key (encrypted)
docker-compose psdocker-compose logs <service-name>docker-compose exec postgres-frontend psql -U frontend_user -d frontend_db -c "SELECT 1;"ls -la secrets/- Never commit secrets to version control
- Regularly rotate secrets and certificates
- Monitor for security updates to base images
- Implement proper backup and disaster recovery
- Use a proper secrets management system for production
- Regularly audit access logs and security configurations
- Consider implementing additional monitoring and alerting
For issues and questions:
- Check service logs for error details
- Verify all configuration values are correct
- Ensure all required files are present and have correct permissions
- Validate OIDC provider configuration