MetaTrader5-Docker-Image/docker-compose.yaml

65 lines
2.2 KiB
YAML
Raw Normal View History

2026-11-03 19:51:32 +00:00
services:
2026-11-04 21:35:18 +00:00
# 1. MetaTrader 5 (Wine + KasmVNC) – startet selbst den RPyC-Server auf 8001
2026-11-03 19:51:32 +00:00
mt5:
2026-11-04 21:35:18 +00:00
image: gmag11/metatrader5_vnc # kein "build: ." – fertiges Image reicht
2026-11-03 19:51:32 +00:00
container_name: mt5
volumes:
- ./config:/config
ports:
2026-11-04 21:35:18 +00:00
- 3000:3000 # Web-UI
# 8001 (RPyC) bewusst NICHT veröffentlicht – ungeschützter Vollzugriff auf MT5
2026-11-03 19:51:32 +00:00
env_file:
2026-11-04 21:35:18 +00:00
- .env # CUSTOM_USER / PASSWORD fürs Web-UI
restart: unless-stopped
healthcheck:
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/8001"]
interval: 30s
timeout: 5s
start_period: 10m # Erststart installiert Wine + MT5
retries: 5
2026-11-03 19:51:32 +00:00
2026-11-04 21:35:18 +00:00
# 2. MCP-Server (FastAPI) – spricht per RPyC mit MT5, Broker-Login aus bots.env
mt5-mcp:
build: ./bots
image: mt5-bots:local
container_name: mt5-mcp
command: ["python", "mcp_server.py", "--live", "--rpyc-host", "mt5", "--rpyc-port", "8001"]
env_file:
- bots.env
ports:
- 127.0.0.1:8000:8000 # nur lokal – hat Order-Endpunkte ohne Auth
depends_on:
mt5:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c",
"import json,urllib.request,sys; d=json.load(urllib.request.urlopen('http://127.0.0.1:8000/health',timeout=5)); sys.exit(0 if d.get('connected') else 1)"]
interval: 30s
timeout: 10s
start_period: 2m
retries: 3
# 3. Telegram Live-Trader – handelt über den MCP-Server
live-trader:
image: mt5-bots:local
container_name: live-trader
working_dir: /data # Session + diagnostics_*.json landen im Volume
# Nur Kanal 2 (HM XAUUSD) – CHANNEL2_ID kommt aus bots.env
command: >
python /app/live_signal_trader.py --live
--channels ch2
--risk-tier low
--mt5-base-url http://mt5-mcp:8000
--diagnostics-dir /data
env_file:
- bots.env
environment:
- TG_SESSION=/data/mysession
volumes:
- ./trader-data:/data
depends_on:
mt5-mcp:
condition: service_healthy
restart: unless-stopped