MetaTrader5-Docker-Goldex/docker-compose.yaml
2026-11-06 14:56:13 +01:00

65 lines
2.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

services:
# 1. MetaTrader 5 (Wine + KasmVNC) – startet selbst den RPyC-Server auf 8001
mt5-gx:
build: . # eigenes Dockerfile mit Fix
image: mt5-vnc-gx:local # eigener Name – nicht mit dem Upstream-Image verwechseln
container_name: mt5-gx
volumes:
- ./config:/config
ports:
- 3010:3000 # Web-UI
# 8001 (RPyC) bewusst NICHT veröffentlicht – ungeschützter Vollzugriff auf MT5
env_file:
- .env # CUSTOM_USER / PASSWORD = VNC-Login 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
# 2. MCP-Server (FastAPI) – spricht per RPyC mit MT5, Broker-Login aus bots.env
mt5-mcp-gx:
build: ./bots
image: mt5-bots-gx:local
container_name: mt5-mcp-gx
command: ["python", "mcp_server.py", "--live", "--rpyc-host", "mt5", "--rpyc-port", "8001"]
env_file:
- bots.env
ports:
- 127.0.0.1:8010:8000 # nur lokal – hat Order-Endpunkte ohne Auth
depends_on:
mt5-gx:
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-gx:
image: mt5-bots-gx:local
container_name: live-trader-gx
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 ch1
--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-gx:
condition: service_healthy
restart: unless-stopped