forked from LengKundee/MQL5-Google-Onedrive
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
Development Container Setup Guide
This guide explains how to set up and use the development container for the MQL5 Trading Automation system.
Prerequisites
- Docker Desktop (Windows/Mac) or Docker Engine (Linux)
- VS Code with the Dev Containers extension
- Git (for cloning the repository)
Quick Start
Option 1: VS Code Dev Container (Recommended)
-
Open in VS Code
code C:\Users\USER\Documents\repos\MQL5-Google-Onedrive -
Reopen in Container
- Press
F1orCtrl+Shift+P - Type:
Dev Containers: Reopen in Container - Select the command
- Wait for the container to build (first time takes ~5-10 minutes)
- Press
-
Container is Ready!
- All dependencies are installed
- Python environment is configured
- You can start coding immediately
Option 2: Docker Compose (Local Development)
-
Start Development Environment
docker-compose -f docker-compose.dev.yml up -d -
Access the Container
docker exec -it mql5-trading-dev bash -
Run Commands
# Install dependencies (if needed) pip install -r requirements.txt # Run Telegram bot python scripts/telegram_deploy_bot.py # Run deployment script python scripts/deploy_cloud.py flyio -
Stop the Container
docker-compose -f docker-compose.dev.yml down
Container Features
Pre-installed Tools
- Python 3.11 with pip
- Git for version control
- Development Tools: black, pylint, pytest, ipython
- System Tools: vim, nano, curl, wget
VS Code Extensions (Auto-installed)
- Python
- Pylance
- Black Formatter
- Docker
- GitHub Copilot
- GitLens
- PowerShell
Port Forwarding
- 8080: Main application
- 5000: API server (if needed)
- 3000: Dashboard (if needed)
Development Workflow
1. Making Changes
- Edit files directly in VS Code
- Changes are synced to the container via volume mounts
- No need to rebuild the container
2. Running Scripts
# In VS Code terminal (inside container)
python scripts/telegram_deploy_bot.py
python scripts/deploy_cloud.py flyio
3. Testing
# Run tests (if available)
pytest
# Format code
black scripts/
# Lint code
pylint scripts/
4. Installing New Dependencies
# Add to requirements.txt
pip install new-package
pip freeze > requirements.txt
Cloud Deployment
Deploy to Fly.io
# From inside the container
flyctl deploy
Deploy to Render
- Push to GitHub
- Connect repository to Render
- Render auto-detects
render.yaml
Deploy to Railway
# Install Railway CLI
npm i -g @railway/cli
# Deploy
railway up
Troubleshooting
Container Won't Start
-
Check Docker is Running
docker ps -
Rebuild Container
# In VS Code: F1 → Dev Containers: Rebuild Container # Or via command line: docker-compose -f docker-compose.dev.yml build --no-cache
Port Already in Use
- Change ports in
docker-compose.dev.yml - Or stop the conflicting service
Python Module Not Found
-
Install in container
pip install -r requirements.txt -
Check PYTHONPATH
echo $PYTHONPATH # Should be /app
Permission Errors
-
Check file permissions
ls -la scripts/ -
Make executable
chmod +x scripts/*.py
File Structure
.devcontainer/
└── devcontainer.json # VS Code dev container config
Dockerfile.dev # Development Docker image
Dockerfile.cloud # Production Docker image
docker-compose.dev.yml # Local development setup
requirements.txt # Python dependencies