File size: 887 Bytes
12f0507 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #!/bin/bash
set -e
export DB_PATH="${DB_PATH:-/app/data/medmembers.db}"
# Always rebuild database to ensure secrets (ADMIN_EMAIL/PASSWORD) are applied
echo "Building database with current environment..."
rm -f "$DB_PATH"
python import_data.py
echo "Database built successfully."
# Import media files index if available (Telegram video references)
if [ -f "/app/data/media_files.json" ]; then
echo "Importing media files index..."
python telegram_uploader.py --import-json /app/data/media_files.json
echo "Media files imported."
elif [ -f "/app/media_files.json" ]; then
echo "Importing media files index..."
python telegram_uploader.py --import-json /app/media_files.json
echo "Media files imported."
fi
echo "Starting MedMembers OFT server on port ${PORT:-7860}..."
exec gunicorn --worker-class eventlet -w 1 -b "0.0.0.0:${PORT:-7860}" --timeout 120 app:app
|