Initial release: DictIA v0.8.14-alpha (fork de Speakr, AGPL-3.0)
This commit is contained in:
25
scripts/docker-entrypoint.sh
Normal file
25
scripts/docker-entrypoint.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Create necessary directories
|
||||
mkdir -p /data/uploads /data/instance
|
||||
chmod 755 /data/uploads /data/instance
|
||||
|
||||
# Initialize the database if it doesn't exist
|
||||
if [ ! -f /data/instance/transcriptions.db ]; then
|
||||
echo "Database doesn't exist. Creating new database..."
|
||||
python -c "from src.app import app, db; app.app_context().push(); db.create_all()"
|
||||
echo "Database created successfully."
|
||||
else
|
||||
echo "Database exists. Checking for schema updates..."
|
||||
python -c "from src.app import app; app.app_context().push()"
|
||||
fi
|
||||
|
||||
# Check if we need to create an admin user (regardless of whether the database exists)
|
||||
if [ -n "$ADMIN_USERNAME" ] && [ -n "$ADMIN_EMAIL" ] && [ -n "$ADMIN_PASSWORD" ]; then
|
||||
echo "Creating admin user using environment variables..."
|
||||
cd /app && python scripts/docker_create_admin.py
|
||||
fi
|
||||
|
||||
# Start the application
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user