All checks were successful
MT5 Helm GitOps Deploy / build-and-deploy (push) Has been skipped
66 lines
2.3 KiB
YAML
66 lines
2.3 KiB
YAML
services:
|
||
# 1. MetaTrader 5 (Wine + KasmVNC) – startet selbst den RPyC-Server auf 8001
|
||
mt5:
|
||
build: . # eigenes Dockerfile mit Fix
|
||
image: mt5-vnc:local # eigener Name – nicht mit dem Upstream-Image verwechseln
|
||
pull_policy: build # nie gmag11/... aus dem Hub ziehen
|
||
container_name: mt5
|
||
volumes:
|
||
- ./config:/config
|
||
ports:
|
||
- 3000: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:
|
||
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
|