Initial commit

This commit is contained in:
Yas Opisso
2025-12-12 14:44:27 -05:00
commit 3a16615149
22 changed files with 23682 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#!/bin/sh
echo "Starting PocketBase initialization..."
DB_FILE="./pb_data/data.db"
# Step 1: Ensure the database file exists
if [ ! -f "$DB_FILE" ]; then
echo "Database not found. Copying default data..."
cp -r ./pb_data_default/. ./pb_data/
# This is only needed if we don't copy the default data
# ./pocketbase serve --http 0.0.0.0:8090 --automigrate=0 & sleep 4
# kill $(pidof pocketbase)
# Creates the admin user or updates if already exists
echo "Creating admin user"
./pocketbase superuser upsert "$POCKETBASE_ADMIN_USERNAME" "$POCKETBASE_ADMIN_PASSWORD"
fi
# Step 3: Start PocketBase normally
echo "Starting PocketBase..."
./pocketbase serve --http 0.0.0.0:8090