|
| 1 | +# SoulSync WebUI - Docker Deployment Guide |
| 2 | + |
| 3 | +## 🐳 Quick Start |
| 4 | + |
| 5 | +### Prerequisites |
| 6 | +- Docker Engine 20.10+ |
| 7 | +- Docker Compose 1.29+ |
| 8 | +- At least 2GB RAM and 10GB free disk space |
| 9 | + |
| 10 | +### 1. Setup |
| 11 | +```bash |
| 12 | +# Clone or download the repository |
| 13 | +git clone <your-repo-url> |
| 14 | +cd newmusic |
| 15 | + |
| 16 | +# Run setup script |
| 17 | +chmod +x docker-setup.sh |
| 18 | +./docker-setup.sh |
| 19 | +``` |
| 20 | + |
| 21 | +### 2. Configure |
| 22 | +Edit `config/config.json` with your API keys and server settings: |
| 23 | +```json |
| 24 | +{ |
| 25 | + "spotify": { |
| 26 | + "client_id": "your_spotify_client_id", |
| 27 | + "client_secret": "your_spotify_client_secret" |
| 28 | + }, |
| 29 | + "plex": { |
| 30 | + "url": "http://your-plex-server:32400", |
| 31 | + "token": "your_plex_token" |
| 32 | + } |
| 33 | +} |
| 34 | +``` |
| 35 | + |
| 36 | +### 3. Deploy |
| 37 | +```bash |
| 38 | +# Start SoulSync |
| 39 | +docker-compose up -d |
| 40 | + |
| 41 | +# View logs |
| 42 | +docker-compose logs -f |
| 43 | + |
| 44 | +# Access the web interface |
| 45 | +open http://localhost:8008 |
| 46 | +``` |
| 47 | + |
| 48 | +## 📁 Volume Mounts |
| 49 | + |
| 50 | +SoulSync requires persistent storage for: |
| 51 | + |
| 52 | +- **`./config`** → `/app/config` - Configuration files |
| 53 | +- **`./database`** → `/app/database` - SQLite database files |
| 54 | +- **`./logs`** → `/app/logs` - Application logs |
| 55 | +- **`./downloads`** → `/app/downloads` - Downloaded music files |
| 56 | +- **`./Transfer`** → `/app/Transfer` - Processed/matched music files |
| 57 | + |
| 58 | +## 🔧 Configuration Options |
| 59 | + |
| 60 | +### Environment Variables |
| 61 | +```yaml |
| 62 | +environment: |
| 63 | + - FLASK_ENV=production # Flask environment |
| 64 | + - PYTHONPATH=/app # Python path |
| 65 | + - SOULSYNC_CONFIG_PATH=/app/config/config.json # Config file location |
| 66 | + - TZ=America/New_York # Timezone |
| 67 | +``` |
| 68 | +
|
| 69 | +### Port Configuration |
| 70 | +Default port is `8008`. To change: |
| 71 | +```yaml |
| 72 | +ports: |
| 73 | + - "9999:8008" # Access on port 9999 |
| 74 | +``` |
| 75 | + |
| 76 | +### Resource Limits |
| 77 | +Adjust based on your system: |
| 78 | +```yaml |
| 79 | +deploy: |
| 80 | + resources: |
| 81 | + limits: |
| 82 | + cpus: '4.0' # Max CPU cores |
| 83 | + memory: 4G # Max RAM |
| 84 | + reservations: |
| 85 | + cpus: '1.0' # Minimum CPU |
| 86 | + memory: 1G # Minimum RAM |
| 87 | +``` |
| 88 | + |
| 89 | +## 🚀 Advanced Setup |
| 90 | + |
| 91 | +### Multi-Architecture Support |
| 92 | +The Docker image supports both AMD64 and ARM64: |
| 93 | +```bash |
| 94 | +# Build for specific architecture |
| 95 | +docker buildx build --platform linux/amd64,linux/arm64 -t soulsync-webui . |
| 96 | +``` |
| 97 | + |
| 98 | +### Custom Network |
| 99 | +For integration with other containers: |
| 100 | +```yaml |
| 101 | +networks: |
| 102 | + media: |
| 103 | + external: true |
| 104 | +``` |
| 105 | + |
| 106 | +### External Services |
| 107 | +Connect to external Plex/Jellyfin servers: |
| 108 | +```yaml |
| 109 | +extra_hosts: |
| 110 | + - "plex.local:192.168.1.100" |
| 111 | + - "jellyfin.local:192.168.1.101" |
| 112 | +``` |
| 113 | + |
| 114 | +## 🔍 Troubleshooting |
| 115 | + |
| 116 | +### Check Container Status |
| 117 | +```bash |
| 118 | +docker-compose ps |
| 119 | +docker-compose logs soulsync |
| 120 | +``` |
| 121 | + |
| 122 | +### Common Issues |
| 123 | + |
| 124 | +**Permission Denied** |
| 125 | +```bash |
| 126 | +sudo chown -R 1000:1000 config database logs downloads Transfer |
| 127 | +``` |
| 128 | + |
| 129 | +**Port Already in Use** |
| 130 | +```bash |
| 131 | +# Check what's using port 8888 |
| 132 | +sudo lsof -i :8888 |
| 133 | +# Change port in docker-compose.yml |
| 134 | +``` |
| 135 | + |
| 136 | +**Out of Memory** |
| 137 | +```bash |
| 138 | +# Increase memory limits in docker-compose.yml |
| 139 | +# Or free up system memory |
| 140 | +``` |
| 141 | + |
| 142 | +### Health Check |
| 143 | +The container includes health checks: |
| 144 | +```bash |
| 145 | +docker inspect --format='{{.State.Health.Status}}' soulsync-webui |
| 146 | +``` |
| 147 | + |
| 148 | +## 📊 Monitoring |
| 149 | + |
| 150 | +### View Real-time Logs |
| 151 | +```bash |
| 152 | +docker-compose logs -f --tail=100 |
| 153 | +``` |
| 154 | + |
| 155 | +### Container Stats |
| 156 | +```bash |
| 157 | +docker stats soulsync-webui |
| 158 | +``` |
| 159 | + |
| 160 | +### Database Size |
| 161 | +```bash |
| 162 | +du -sh database/ |
| 163 | +``` |
| 164 | + |
| 165 | +## 🔄 Updates |
| 166 | + |
| 167 | +### Pull Latest Image |
| 168 | +```bash |
| 169 | +docker-compose pull |
| 170 | +docker-compose up -d |
| 171 | +``` |
| 172 | + |
| 173 | +### Backup Before Update |
| 174 | +```bash |
| 175 | +# Backup data |
| 176 | +tar -czf soulsync-backup-$(date +%Y%m%d).tar.gz config/ database/ logs/ |
| 177 | +
|
| 178 | +# Update |
| 179 | +docker-compose pull && docker-compose up -d |
| 180 | +``` |
| 181 | + |
| 182 | +## 🛠️ Development |
| 183 | + |
| 184 | +### Build Local Image |
| 185 | +```bash |
| 186 | +docker build -t soulsync-webui . |
| 187 | +``` |
| 188 | + |
| 189 | +### Development Mode |
| 190 | +```yaml |
| 191 | +# In docker-compose.yml |
| 192 | +environment: |
| 193 | + - FLASK_ENV=development |
| 194 | +volumes: |
| 195 | + - .:/app # Mount source code for live reload |
| 196 | +``` |
| 197 | + |
| 198 | +## 🔐 Security |
| 199 | + |
| 200 | +### Non-Root User |
| 201 | +The container runs as user `soulsync` (UID 1000) for security. |
| 202 | + |
| 203 | +### Network Security |
| 204 | +```yaml |
| 205 | +# Restrict to localhost only |
| 206 | +ports: |
| 207 | + - "127.0.0.1:8888:8888" |
| 208 | +``` |
| 209 | + |
| 210 | +### Firewall |
| 211 | +```bash |
| 212 | +# Allow only local access |
| 213 | +sudo ufw allow from 192.168.1.0/24 to any port 8888 |
| 214 | +``` |
| 215 | + |
| 216 | +## 📋 Complete Example |
| 217 | + |
| 218 | +Here's a complete `docker-compose.yml` for production: |
| 219 | + |
| 220 | +```yaml |
| 221 | +version: '3.8' |
| 222 | +
|
| 223 | +services: |
| 224 | + soulsync: |
| 225 | + build: . |
| 226 | + container_name: soulsync-webui |
| 227 | + restart: unless-stopped |
| 228 | + ports: |
| 229 | + - "8888:8888" |
| 230 | + volumes: |
| 231 | + - ./config:/app/config |
| 232 | + - ./database:/app/database |
| 233 | + - ./logs:/app/logs |
| 234 | + - ./downloads:/app/downloads |
| 235 | + - ./Transfer:/app/Transfer |
| 236 | + - /mnt/music:/music:ro # Your music library |
| 237 | + environment: |
| 238 | + - FLASK_ENV=production |
| 239 | + - TZ=America/New_York |
| 240 | + - PYTHONPATH=/app |
| 241 | + deploy: |
| 242 | + resources: |
| 243 | + limits: |
| 244 | + cpus: '2.0' |
| 245 | + memory: 2G |
| 246 | + reservations: |
| 247 | + cpus: '0.5' |
| 248 | + memory: 512M |
| 249 | + healthcheck: |
| 250 | + test: ["CMD", "curl", "-f", "http://localhost:8888/"] |
| 251 | + interval: 30s |
| 252 | + timeout: 10s |
| 253 | + retries: 3 |
| 254 | + start_period: 60s |
| 255 | + logging: |
| 256 | + driver: "json-file" |
| 257 | + options: |
| 258 | + max-size: "10m" |
| 259 | + max-file: "3" |
| 260 | +``` |
| 261 | + |
| 262 | +## 🎯 Production Checklist |
| 263 | + |
| 264 | +- [ ] Configure proper API keys in `config/config.json` |
| 265 | +- [ ] Set appropriate resource limits |
| 266 | +- [ ] Configure proper volume mounts |
| 267 | +- [ ] Set up log rotation |
| 268 | +- [ ] Configure firewall rules |
| 269 | +- [ ] Set up backup strategy |
| 270 | +- [ ] Test health checks |
| 271 | +- [ ] Verify external service connectivity |
0 commit comments