Update environment variables and enhance Docker configurations for improved deployment
- Modified .env.portainer to include new environment variables for S3 private bucket URL, Nostr JWT secrets, and SendGrid options. - Updated docker-compose.yml to support the new environment variables, enhancing service configurations. - Added a seed content script to the backend package.json for initializing the database with sample data. - Refactored helper functions to construct S3 URLs more robustly, accommodating potential missing configurations. - Enhanced dev.sh script to seed the database if empty, ensuring content availability during development.
This commit is contained in:
@@ -284,6 +284,14 @@ for i in $(seq 1 60); do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
# Seed database if empty (so catalog and films appear; user uploads require re-upload after DB reset)
|
||||
PROJECT_COUNT=$(curl -s "http://localhost:$BACKEND_PORT/projects" 2>/dev/null | grep -o '"id"' | wc -l | tr -d ' ')
|
||||
if [ "$PROJECT_COUNT" = "0" ] || [ -z "$PROJECT_COUNT" ]; then
|
||||
echo -e "${CYAN} Database has no projects — seeding content...${NC}"
|
||||
(cd "$BACKEND_DIR" && set -a && [ -f .env ] && . ./.env && set +a && npm run seed:content 2>&1 | prefix_output "seed-db" "$CYAN") || true
|
||||
echo -e "${GREEN} Seed done. Reload the app to see the catalog.${NC}"
|
||||
fi
|
||||
|
||||
# ═════════════════════════════════════════════════════════════
|
||||
# STEP 4 — Frontend dev server
|
||||
# ═════════════════════════════════════════════════════════════
|
||||
|
||||
Reference in New Issue
Block a user