feat: add free deployment configs for Railway, Render, Fly.io
- railway.toml for Railway.app deployment - fly.toml for Fly.io deployment - render.yaml for Render.com deployment - deploy.sh quick deployment helper script - DEPLOY.md with detailed instructions All configs optimized for free tier usage.
This commit is contained in:
parent
3390576eea
commit
ba1941012b
5 changed files with 190 additions and 0 deletions
58
DEPLOY.md
Normal file
58
DEPLOY.md
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# 🚀 Deploy PicoClaw for Free
|
||||
|
||||
## Quick Deploy
|
||||
|
||||
### Railway.app (Recommended)
|
||||
|
||||
[](https://railway.app/template)
|
||||
|
||||
1. Click "Deploy on Railway"
|
||||
2. Set environment variables:
|
||||
- `TELEGRAM_BOT_TOKEN` - Your bot token from @BotFather
|
||||
- `ZHIPU_API_KEY` - Your GLM API key from Z.AI
|
||||
|
||||
### Render.com
|
||||
|
||||
[](https://render.com/deploy)
|
||||
|
||||
1. Click "Deploy to Render"
|
||||
2. Connect GitHub repo
|
||||
3. Set environment variables
|
||||
4. Deploy
|
||||
|
||||
### Fly.io
|
||||
|
||||
```bash
|
||||
# Install CLI
|
||||
brew install flyctl
|
||||
|
||||
# Login
|
||||
fly auth login
|
||||
|
||||
# Deploy
|
||||
fly launch
|
||||
fly deploy
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
| Variable | Required | Description |
|
||||
|----------|----------|-------------|
|
||||
| `TELEGRAM_BOT_TOKEN` | ✅ | Bot token from @BotFather |
|
||||
| `ZHIPU_API_KEY` | ✅ | GLM API key from Z.AI |
|
||||
| `WEB_SEARCH_ENABLED` | ❌ | Enable web search (default: true) |
|
||||
| `WEB_SEARCH_PROVIDER` | ❌ | duckduckgo or brave |
|
||||
|
||||
## Files Created
|
||||
|
||||
- `railway.toml` - Railway config
|
||||
- `fly.toml` - Fly.io config
|
||||
- `render.yaml` - Render blueprint
|
||||
- `deploy.sh` - Quick deploy script
|
||||
|
||||
## Run Deploy Script
|
||||
|
||||
```bash
|
||||
cd /Users/adisusilayasa/picoclaw
|
||||
./deploy.sh
|
||||
```
|
||||
76
deploy.sh
Executable file
76
deploy.sh
Executable file
|
|
@ -0,0 +1,76 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "🦞 PicoClaw Deployment Helper"
|
||||
echo "=============================="
|
||||
echo ""
|
||||
echo "Choose deployment platform:"
|
||||
echo ""
|
||||
echo "1) Railway.app (Recommended - $5/month free credit)"
|
||||
echo "2) Render.com (Free - 750 hours/month)"
|
||||
echo "3) Fly.io (Free - 3 VMs)"
|
||||
echo "4) Show instructions only"
|
||||
echo ""
|
||||
read -p "Enter choice [1-4]: " choice
|
||||
|
||||
case $choice in
|
||||
1)
|
||||
echo ""
|
||||
echo "📦 Deploying to Railway..."
|
||||
echo ""
|
||||
|
||||
# Check if Railway CLI is installed
|
||||
if ! command -v railway &> /dev/null; then
|
||||
echo "Installing Railway CLI..."
|
||||
npm install -g @railway/cli
|
||||
fi
|
||||
|
||||
# Login if needed
|
||||
railway login
|
||||
|
||||
# Initialize project
|
||||
echo ""
|
||||
echo "Run these commands:"
|
||||
echo " railway init"
|
||||
echo " railway variables set TELEGRAM_BOT_TOKEN=YOUR_TOKEN"
|
||||
echo " railway variables set ZHIPU_API_KEY=YOUR_KEY"
|
||||
echo " railway up"
|
||||
;;
|
||||
2)
|
||||
echo ""
|
||||
echo "📦 Deploying to Render..."
|
||||
echo ""
|
||||
echo "Steps:"
|
||||
echo "1. Go to https://render.com"
|
||||
echo "2. Create account"
|
||||
echo "3. New → Web Service"
|
||||
echo "4. Connect GitHub repo"
|
||||
echo "5. Select Docker environment"
|
||||
echo "6. Add environment variables"
|
||||
echo "7. Deploy"
|
||||
;;
|
||||
3)
|
||||
echo ""
|
||||
echo "📦 Deploying to Fly.io..."
|
||||
echo ""
|
||||
|
||||
# Check if Fly CLI is installed
|
||||
if ! command -v fly &> /dev/null; then
|
||||
echo "Installing Fly CLI..."
|
||||
brew install flyctl
|
||||
fi
|
||||
|
||||
echo "Run these commands:"
|
||||
echo " fly auth login"
|
||||
echo " fly secrets set TELEGRAM_BOT_TOKEN=YOUR_TOKEN"
|
||||
echo " fly secrets set ZHIPU_API_KEY=YOUR_KEY"
|
||||
echo " fly launch"
|
||||
echo " fly deploy"
|
||||
;;
|
||||
4)
|
||||
echo ""
|
||||
echo "📖 See ~/.picoclaw/workspace/DEPLOYMENT.md for detailed instructions"
|
||||
;;
|
||||
*)
|
||||
echo "Invalid choice"
|
||||
;;
|
||||
esac
|
||||
28
fly.toml
Normal file
28
fly.toml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
app = "picoclaw-claw"
|
||||
primary_region = "sin"
|
||||
|
||||
[build]
|
||||
dockerfile = "Dockerfile"
|
||||
|
||||
[env]
|
||||
PORT = "8080"
|
||||
|
||||
[[services]]
|
||||
internal_port = 8080
|
||||
protocol = "tcp"
|
||||
auto_stop_machines = false
|
||||
auto_start_machines = false
|
||||
min_machines_running = 1
|
||||
|
||||
[[services.ports]]
|
||||
handlers = ["http"]
|
||||
port = 80
|
||||
|
||||
[[services.ports]]
|
||||
handlers = ["tls", "http"]
|
||||
port = 443
|
||||
|
||||
[[vm]]
|
||||
cpu_kind = "shared"
|
||||
cpus = 1
|
||||
memory_mb = 256
|
||||
8
railway.toml
Normal file
8
railway.toml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[build]
|
||||
builder = "DOCKERFILE"
|
||||
dockerfilePath = "Dockerfile"
|
||||
|
||||
[deploy]
|
||||
startCommand = "./build/picoclaw gateway"
|
||||
restartPolicyType = "ON_FAILURE"
|
||||
restartPolicyMaxRetries = 10
|
||||
20
render.yaml
Normal file
20
render.yaml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
services:
|
||||
- type: web
|
||||
name: picoclaw
|
||||
runtime: docker
|
||||
dockerContext: .
|
||||
dockerfilePath: ./Dockerfile
|
||||
plan: free
|
||||
envVars:
|
||||
- key: TELEGRAM_BOT_TOKEN
|
||||
sync: false
|
||||
- key: ZHIPU_API_KEY
|
||||
sync: false
|
||||
- key: WEB_SEARCH_ENABLED
|
||||
value: true
|
||||
- key: WEB_SEARCH_PROVIDER
|
||||
value: duckduckgo
|
||||
disk:
|
||||
name: picoclaw-data
|
||||
mountPath: /root/.picoclaw
|
||||
sizeGB: 1
|
||||
Loading…
Add table
Reference in a new issue