mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-21 13:25:14 +02:00
- Move images directory from /data/images to /app/images to separate app data from user media - Implement config folder approach instead of direct file mounting - Add automatic config initialization with example config on first boot - Remove hardcoded media directory environment variables from Dockerfile - Update startup script to handle config folder setup and validation - Only create application-managed directories, not user media directories - Update docker-compose.yaml to use config folder volume mapping Fixes container startup failures when config.toml doesn't exist and improves separation between application data and user media directories.
3.9 KiB
3.9 KiB
MediaManager Setup Improvements
This document outlines the improvements made to the MediaManager container setup to address common deployment issues.
Changes Made
1. Automatic Directory Creation
- Problem: The application expected certain directories to exist but only created them in development mode
- Solution: The application now creates only the directories it manages (like
/app/imagesfor application data). Media directories are user-configured and mounted as volumes, so the application doesn't need to create them.
2. Images Directory Relocated
- Problem: Images were stored in
/data/imageswhich should be reserved for user media - Solution: Images are now stored in
/app/imageswithin the application context, keeping user data separate from application data
3. Config Folder Approach
- Problem: The container required users to create a
config.tomlfile before first boot, causing startup failures - Solution:
- Changed from direct file mapping to config folder mapping
- Added automatic config initialization on first boot
- Example config is copied to the config folder if no config exists
- Container can now start successfully without pre-existing configuration
New Volume Structure
Before:
volumes:
- ./data/:/data/
- ./config.toml:/app/config.toml # Required file that users had to create
After:
volumes:
- ./data/:/data/
- ./config/:/app/config/ # Config folder that gets auto-initialized
First Boot Process
- Container starts and checks for config directory
- If config directory doesn't exist, it's created
- If
config.tomldoesn't exist in the config directory, the example config is copied - Application-managed directories (like images) are created automatically
- Database migrations run
- Application starts successfully
Note: Media directories are NOT created by the application - they should be mounted from your host system.
User Experience Improvements
- No pre-setup required: Users can now run
docker-compose upimmediately - Clear configuration path: Config file location is clearly communicated during startup
- Example configuration: Users get a working example config with helpful comments
- Separation of concerns: User data (
/data/) is separate from app data (/app/images)
Migration for Existing Users
If you have an existing setup:
- Create a
configfolder in your docker-compose directory - Move your existing
config.tomlfile into theconfigfolder - Update your
docker-compose.yamlto use the new volume mapping - Remove any existing
/data/imagesfolder (images will now be stored in the container)
Directory Management
Application-Managed Directories
/app/images: Created automatically by the application for storing metadata images/app/config: Config folder mounted as volume, auto-initialized on first boot
User-Managed Directories
- Media directories (TV shows, movies, torrents): These are defined in your
config.tomland should be mounted as volumes in yourdocker-compose.yaml - The application does NOT create these directories - they should exist on your host system and be properly mounted
Example Volume Mapping
volumes:
# Your actual media directories
- /path/to/your/tv/shows:/data/tv
- /path/to/your/movies:/data/movies
# Config folder (auto-initialized)
- ./config/:/app/config/
Then in your config.toml:
[[misc.tv_libraries]]
name = "TV Shows"
path = "/data/tv" # This matches the container path from volume mount
[[misc.movie_libraries]]
name = "Movies"
path = "/data/movies" # This matches the container path from volume mount
Environment Variables
CONFIG_DIR: Path to config directory (default:/app/config)MISC__IMAGE_DIRECTORY: Path to images directory (default:/app/images)- Media directory environment variables removed - these should be configured in
config.toml