File size: 2,564 Bytes
667bab7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
# Render Deployment Script
# Run on your LOCAL machine (Windows/Linux/Mac)

set -e

echo "=========================================="
echo "  Deploy Lao Python Learning Platform"
echo "  to Render.com (FREE)"
echo "=========================================="
echo ""

# Check prerequisites
if ! command -v git &> /dev/null; then
    echo "❌ git not found. Install git first:"
    echo "   Windows: https://git-scm.com/download/win"
    echo "   macOS: brew install git"
    echo "   Linux: sudo apt install git"
    exit 1
fi

if ! command -v docker &> /dev/null; then
    echo "⚠️  docker not found. Required for Cloud Run."
    echo "   For Render, git push is sufficient."
fi

echo "πŸ“ Current directory: $(pwd)"
echo ""
echo "πŸ“‹ Files to deploy:"
ls -la *.py *.txt *.yaml 2>/dev/null || echo "   (check manually)"
echo ""
echo "=========================================="
echo "  STEP 1: Create GitHub Repository"
echo "=========================================="
echo ""
echo "1. Go to https://github.com/new"
echo "2. Create new repository: lao-python-learn"
echo "3. Don't initialize with README"
echo "4. Copy the repo URL"
echo ""
echo "=========================================="
echo "  STEP 2: Push Code to GitHub"
echo "=========================================="
echo ""
echo "Run these commands:"
echo ""
echo "  git init"
echo "  git add ."
echo "  git commit -m 'Initial commit: Lao Python Learning Platform'"
echo "  git branch -M main"
echo "  git remote add origin https://github.com/YOUR_USERNAME/lao-python-learn.git"
echo "  git push -u origin main"
echo ""
echo "Replace YOUR_USERNAME with your GitHub username."
echo ""
echo "=========================================="
echo "  STEP 3: Deploy to Render"
echo "=========================================="
echo ""
echo "1. Go to https://dashboard.render.com"
echo "2. Sign in with GitHub"
echo "3. Click 'New' β†’ 'Web Service'"
echo "4. Select your repository: lao-python-learn"
echo "5. Configure:"
echo "   - Name: lao-python-learn"
echo "   - Build Command: pip install -r requirements.txt"
echo "   - Start Command: gradio app.py --server.port \$PORT --server.host 0.0.0.0"
echo "   - Instance Type: Free"
echo "6. Click 'Deploy'"
echo ""
echo "=========================================="
echo "  DONE!"
echo "=========================================="
echo ""
echo "Your app will be at:"
echo "  https://lao-python-learn.onrender.com"
echo ""
echo "Note: Free tier sleeps after 15 min inactivity."
echo "      First visit after sleep takes ~30 seconds."
echo ""