-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-render.sh
More file actions
executable file
·71 lines (69 loc) · 2.75 KB
/
Copy pathdeploy-render.sh
File metadata and controls
executable file
·71 lines (69 loc) · 2.75 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
# Mapfolio Backend Deployment Script for Render.com
# This script provides instructions for deploying to Render.com
echo "🚀 Mapfolio Backend Deployment to Render.com"
echo ""
echo "📋 Prerequisites:"
echo "1. Render account at render.com"
echo "2. GitHub repository with your code"
echo "3. Neon database account"
echo "4. Redis (Upstash or Render Redis)"
echo ""
echo "🎯 Deployment Strategy:"
echo "We'll use keep-alive pings to prevent spin-down (every 20 seconds)"
echo ""
echo "📦 Manual Deployment Steps:"
echo ""
echo "1. Deploy AI Services:"
echo " - Go to render.com → New → Web Service"
echo " - Connect your GitHub repository"
echo " - Select: backend/ai-services directory"
echo " - Build: pip install -r requirements.txt"
echo " - Start: uvicorn main:app --host 0.0.0.0 --port \$PORT"
echo " - Set environment variables:"
echo " • DATABASE_URL=your_neon_database_url"
echo " • REDIS_URL=your_redis_url"
echo " • OPENAI_API_KEY=your_openai_key"
echo " • GOOGLE_MAPS_API_KEY=your_maps_key"
echo " • API_GATEWAY_URL=https://mapfolio-api-gateway.onrender.com"
echo " • FRONTEND_URL=https://mapfolio.pages.dev"
echo " • ENVIRONMENT=production"
echo ""
echo "2. Deploy API Gateway:"
echo " - Go to render.com → New → Web Service"
echo " - Connect your GitHub repository"
echo " - Select: backend/api-gateway directory"
echo " - Build: pip install -r requirements.txt"
echo " - Start: uvicorn main:app --host 0.0.0.0 --port \$PORT"
echo " - Set environment variables:"
echo " • AI_SERVICES_URL=https://mapfolio-ai-services.onrender.com"
echo " • FRONTEND_URL=https://mapfolio.pages.dev"
echo " • JWT_SECRET_KEY=generate_secure_key"
echo " • ENVIRONMENT=production"
echo " • RATE_LIMIT_ENABLED=true"
echo " • RATE_LIMIT_PER_MINUTE=100"
echo ""
echo "3. Set Up Keep-Alive Pings:"
echo " - Enable GitHub Actions workflows in your repo"
echo " - Workflows will ping services every 20 seconds"
echo " - This prevents Render's 15-minute spin-down"
echo ""
echo "4. Update Frontend:"
echo " - Set VITE_API_URL=https://mapfolio-api-gateway.onrender.com"
echo " - Deploy to Cloudflare Pages"
echo ""
echo "🔍 Alternative: UptimeRobot Setup"
echo "1. Create account at uptimerobot.com"
echo "2. Add monitors for:"
echo " - https://mapfolio-api-gateway.onrender.com/health"
echo " - https://mapfolio-ai-services.onrender.com/health"
echo "3. Set interval to 1 minute"
echo ""
echo "📚 For detailed guide, see DEPLOYMENT.md"
echo ""
echo "✨ Benefits of this setup:"
echo " - Free tier on Render.com"
echo " - No credit card required"
echo " - Keep-alive pings prevent spin-down"
echo " - Python/FastAPI native support"
echo " - Easy upgrade path to paid tier"