修复config.yaml的初始化逻辑

This commit is contained in:
puke
2025-11-05 10:57:06 +08:00
parent 1683f43423
commit ace406cd69
2 changed files with 30 additions and 12 deletions

View File

@@ -11,8 +11,9 @@ services:
ports:
- "8000:8000"
volumes:
# Mount config file (required)
- ./config.yaml:/app/config.yaml:ro
# Mount config file (required, read-write to allow saving from Web UI)
# IMPORTANT: Create config.yaml before first run: cp config.example.yaml config.yaml
- ./config.yaml:/app/config.yaml
# Mount data directories for persistence
# data/ contains: users/, bgm/, templates/, workflows/ (custom resources)
- ./data:/app/data
@@ -46,8 +47,9 @@ services:
ports:
- "8501:8501"
volumes:
# Mount config file (required)
- ./config.yaml:/app/config.yaml:ro
# Mount config file (required, read-write to allow saving from Web UI)
# IMPORTANT: Create config.yaml before first run: cp config.example.yaml config.yaml
- ./config.yaml:/app/config.yaml
# Mount data directories for persistence
# data/ contains: users/, bgm/, templates/, workflows/ (custom resources)
- ./data:/app/data

View File

@@ -7,16 +7,32 @@ echo "🐳 Pixelle-Video Docker Deployment"
echo "=================================="
echo ""
# Check if config.yaml exists
# Check if config.yaml exists as a directory (Docker mount issue)
if [ -d config.yaml ]; then
echo "⚠️ config.yaml is a directory (Docker mount issue), removing it..."
rm -rf config.yaml
fi
# Check if config.yaml exists, if not, create from example
if [ ! -f config.yaml ]; then
echo "❌ Error: config.yaml not found!"
echo "⚠️ config.yaml not found, creating from config.example.yaml..."
if [ -f config.example.yaml ]; then
cp config.example.yaml config.yaml
echo "✅ config.yaml created successfully!"
echo ""
echo "Please create config.yaml before starting:"
echo " 1. Copy from config.example.yaml"
echo " 2. Fill in your API keys and ComfyUI URL"
echo "⚠️ IMPORTANT: Please edit config.yaml and fill in:"
echo " - LLM API key and settings"
echo " - ComfyUI URL (use host.docker.internal:8188 for local Mac/Windows)"
echo " - RunningHub API key (optional, for cloud workflows)"
echo ""
echo "You can also configure these settings in the Web UI after starting."
echo ""
else
echo "❌ Error: config.example.yaml not found!"
echo ""
exit 1
fi
fi
# Check if docker-compose is available
if ! command -v docker-compose &> /dev/null && ! docker compose version &> /dev/null; then