feat: add docs seeding function to all-in-one entrypoint

This commit is contained in:
CREDO23 2026-01-09 16:58:09 +02:00
parent ec145431f2
commit 6f67236143

View file

@ -145,9 +145,29 @@ run_migrations() {
echo "✅ Database migrations complete"
}
# ================================================
# Seed Surfsense documentation
# ================================================
seed_surfsense_docs() {
echo "📚 Seeding Surfsense documentation..."
# Start PostgreSQL temporarily for seeding
su - postgres -c "/usr/lib/postgresql/14/bin/pg_ctl -D /data/postgres -l /tmp/postgres_seed.log start"
sleep 5
cd /app/backend
python scripts/seed_surfsense_docs.py || echo "⚠️ Docs seeding may have already been done"
# Stop PostgreSQL
su - postgres -c "/usr/lib/postgresql/14/bin/pg_ctl -D /data/postgres stop"
echo "✅ Surfsense documentation seeded"
}
# Run migrations on first start or when explicitly requested
if [ ! -f /data/.migrations_run ] || [ "${FORCE_MIGRATIONS:-false}" = "true" ]; then
run_migrations
seed_surfsense_docs
touch /data/.migrations_run
fi