mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-10 20:40:56 +00:00
3.9 KiB
3.9 KiB
Cloud Deployment Guide
This guide covers deploying the MQL5 Trading Automation system to various cloud platforms.
Supported Platforms
- ✅ Fly.io - Fast, global deployment
- ✅ Render.com - Simple, automatic deployments
- ✅ Railway.app - Developer-friendly platform
- ✅ Docker Hub - Container registry
Prerequisites
- Docker installed locally
- Accounts on target cloud platforms
- GitHub repository (for automatic deployments)
Quick Deploy Commands
Fly.io
# Install Fly CLI
curl -L https://fly.io/install.sh | sh
# Login
flyctl auth login
# Deploy
flyctl deploy
# Check status
flyctl status
Render.com
- Push code to GitHub
- Go to https://render.com
- Create new Web Service
- Connect GitHub repository
- Render auto-detects
render.yaml - Deploy!
Railway.app
# Install Railway CLI
npm i -g @railway/cli
# Login
railway login
# Initialize project
railway init
# Deploy
railway up
Configuration Files
Dockerfile.cloud
Production-optimized Docker image:
- Minimal dependencies
- Health checks
- Security best practices
render.yaml
Render.com configuration:
- Auto-deployment from GitHub
- Environment variables
- Health checks
fly.toml
Fly.io configuration:
- Region selection
- Port mapping
- Scaling options
railway.json
Railway.app configuration:
- Build settings
- Start commands
- Restart policies
Environment Variables
Set these in your cloud platform dashboard:
Required
PYTHONUNBUFFERED=1
TZ=UTC
ENV=production
Optional (for Telegram Bot)
TELEGRAM_BOT_TOKEN=your_token_here
TELEGRAM_ALLOWED_USER_IDS=123456789
Secrets Management
Never commit secrets to Git!
- Use platform secret management:
- Fly.io:
flyctl secrets set KEY=value - Render: Dashboard → Environment → Secrets
- Railway: Dashboard → Variables
- Fly.io:
Deployment Workflow
1. Local Testing
# Build production image locally
docker build -f Dockerfile.cloud -t mql5-automation:latest .
# Test locally
docker run -p 8080:8080 mql5-automation:latest
2. Push to GitHub
git add .
git commit -m "Deploy to cloud"
git push origin main
3. Deploy to Cloud
Fly.io:
flyctl deploy
Render:
- Automatic on push (if auto-deploy enabled)
Railway:
railway up
Monitoring
Fly.io
# View logs
flyctl logs
# Check metrics
flyctl status
Render
- Dashboard → Logs tab
- Dashboard → Metrics tab
Railway
# View logs
railway logs
# Check status
railway status
Troubleshooting
Build Fails
-
Check Dockerfile syntax
docker build -f Dockerfile.cloud -t test . -
Check requirements.txt
pip install -r requirements.txt
Container Crashes
-
Check logs
# Fly.io flyctl logs # Render # Dashboard → Logs # Railway railway logs -
Test locally first
docker run mql5-automation:latest
Environment Variables Not Working
- Verify in platform dashboard
- Check variable names (case-sensitive)
- Restart service after adding variables
Cost Optimization
Fly.io
- Free tier: 3 shared-cpu-1x VMs
- Pay-as-you-go for additional resources
Render
- Free tier: 750 hours/month
- Paid plans start at $7/month
Railway
- Free tier: $5 credit/month
- Pay-as-you-go pricing
Security Best Practices
-
Never commit secrets
- Use
.gitignorefor sensitive files - Use platform secret management
- Use
-
Use HTTPS
- All platforms provide SSL certificates
-
Limit access
- Use
TELEGRAM_ALLOWED_USER_IDSfor bot access
- Use
-
Regular updates
- Keep dependencies updated
- Monitor security advisories