mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-11 14:00:57 +00:00
Merged the following branches: - feat-genx-trader-bot-bridge (ZOLO bridge, Docker updates) - feature/zolo-integration-update (ZOLO bridge improvements) - feature/add-web-request (Requests support) - fix-mql5-ask-bid-usage (Fix for MQL5) - update-documentation-and-setup-script (Docs update) - update-trading-bridge-zolo (Bridge IP update) - expert-mapsar-improvements (MAPSAR EA improvements) - remote-control-intelligence-tools-integration (Remote control guide) - feat/cli-documentation (CLI docs) - perf-optimize-validator (Validator script optimization) - jules-docker-run-verification (Verification doc update) Resolved conflicts in: - mt5/MQL5/Experts/SMC_TrendBreakout_MTF_EA.mq5 (Version 1.21, merged improvements) - scripts/ci_validate_repo.py (Kept optimized version) - render.yaml (Merged configs) - docker-compose.yml (Merged configs) - README.md & docs (Merged updates) Security fixes: - Removed hardcoded credentials from setup_github_secrets.ps1 and docs/GITHUB_CI_CD_SETUP.md.
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