Update data directory mapping and config path handling

Changed Docker volume mapping from './database' to './data' in README-Docker.md for SQLite files. Updated web_server.py to support config path override via SOULSYNC_CONFIG_PATH environment variable, improving Docker compatibility.
This commit is contained in:
Broque Thomas 2026-01-06 07:17:35 -08:00
parent e5457c0214
commit 42a4ccfc24
2 changed files with 10 additions and 3 deletions

View file

@ -50,7 +50,7 @@ open http://localhost:8008
SoulSync requires persistent storage for:
- **`./config`** → `/app/config` - Configuration files
- **`./database`** → `/app/database` - SQLite database files
- **`./data`** → `/app/data` - SQLite database files
- **`./logs`** → `/app/logs` - Application logs
- **`./downloads`** → `/app/downloads` - Downloaded music files
- **`./Transfer`** → `/app/Transfer` - Processed/matched music files
@ -229,7 +229,7 @@ services:
- "8888:8888"
volumes:
- ./config:/app/config
- ./database:/app/database
- ./data:/app/data
- ./logs:/app/logs
- ./downloads:/app/downloads
- ./Transfer:/app/Transfer

View file

@ -47,7 +47,14 @@ from beatport_unified_scraper import BeatportUnifiedScraper
# --- Flask App Setup ---
base_dir = os.path.abspath(os.path.dirname(__file__))
project_root = os.path.dirname(base_dir) # Go up one level to the project root
config_path = os.path.join(project_root, 'config', 'config.json')
# Check for environment variable first (Docker support), then fallback to calculated path
env_config_path = os.environ.get('SOULSYNC_CONFIG_PATH')
if env_config_path:
config_path = env_config_path
print(f"🔧 Using config path from environment: {config_path}")
else:
config_path = os.path.join(project_root, 'config', 'config.json')
if os.path.exists(config_path):
print(f"Found config file at: {config_path}")