4.9 KiB
Web Deployment Guide
This guide covers deploying Dibby Wemo Manager as a web service using Docker containers.
Quick Start
Using Docker Compose (Recommended)
-
Build and deploy with one command:
# Linux/macOS ./scripts/web-deploy.sh # Windows powershell -ExecutionPolicy Bypass -File scripts/web-deploy.ps1 -
Or manually:
# Build the Docker image docker build -t reg.dev.nervesocket.com/dibbly:latest . # Start with Docker Compose docker-compose -f web-compose.yml up -d -
Access the web interface:
- Local: http://localhost:3456
- Mobile: http://YOUR_IP:3456
Configuration
Environment Variables
| Variable | Default | Description |
|---|---|---|
DATA_DIR |
/data |
Persistent data directory for device configs and rules |
PORT |
3456 |
HTTP port for the web interface |
Docker Compose Options
The web-compose.yml includes several production-ready features:
- Persistent Data: Uses Docker volumes to store device configurations and rules
- Health Checks: Automatic monitoring of service health
- Restart Policy: Automatically restarts if the service crashes
- Network Isolation: Runs in a dedicated Docker network
Networking Considerations
Wemo Device Discovery
Wemo devices use SSDP (Simple Service Discovery Protocol) which requires special networking:
- Linux: Use
network_mode: hostfor automatic device discovery - macOS/Windows: Host networking isn't supported - add devices manually via the web UI
To enable host networking on Linux, uncomment this line in web-compose.yml:
network_mode: host
Port Configuration
The service runs on port 3456 by default. To change it:
- Update the port mapping in
web-compose.yml - Set the
PORTenvironment variable - Restart the service
Management
View Logs
docker-compose -f web-compose.yml logs -f
Stop Service
docker-compose -f web-compose.yml down
Update Service
# Pull latest image and restart
docker-compose -f web-compose.yml pull
docker-compose -f web-compose.yml up -d
Backup Data
# Backup persistent data
docker run --rm -v dibbly-data:/data -v $(pwd):/backup alpine tar czf /backup/dibbly-backup.tar.gz -C /data .
# Restore data
docker run --rm -v dibbly-data:/data -v $(pwd):/backup alpine tar xzf /backup/dibbly-backup.tar.gz -C /data
Web Interface Features
The web interface provides full parity with the desktop application:
- Device Management: Discover, add, and control Wemo devices
- Scheduling: Create and manage device schedules
- Real-time Updates: WebSocket-based live status updates
- Mobile Optimized: Responsive design for phones and tablets
- Dark Mode: Automatic theme detection
API Endpoints
The service exposes a REST API for integration:
GET /api/devices- List all devicesPOST /api/devices/discover- Discover new devicesGET/POST /api/devices/{host}/{port}/state- Control device stateGET/POST/PUT/DELETE /api/dwm-rules- Manage scheduling rulesGET /api/scheduler/status- Get scheduler status
Troubleshooting
Common Issues
-
Devices not discovered automatically
- On macOS/Windows, add devices manually via the web UI
- On Linux, ensure host networking is enabled
-
Service not accessible
- Check if port 3456 is available
- Verify Docker is running
- Check firewall settings
-
Data persistence issues
- Ensure the Docker volume
dibbly-dataexists - Check permissions on the data directory
- Ensure the Docker volume
Health Checks
The service includes built-in health checks. Monitor status:
docker-compose -f web-compose.yml ps
Performance
For optimal performance:
- Use host networking on Linux for faster device discovery
- Ensure adequate disk space for data persistence
- Monitor memory usage with multiple devices
Security
Network Security
- The service binds to
0.0.0.0by default - Consider using a reverse proxy (nginx/traefik) for production
- Implement authentication if exposing to the internet
Data Protection
- Device configurations are stored in
/data - Regular backups are recommended
- Consider encrypting the data volume in production
Production Deployment
For production environments, consider:
- Reverse Proxy: Use nginx or Traefik for SSL termination
- Authentication: Add authentication layer
- Monitoring: Implement proper logging and monitoring
- Backups: Automated backup strategy
- High Availability: Multiple instances with load balancing
Example nginx configuration:
server {
listen 443 ssl;
server_name your-domain.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://localhost:3456;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}