File size: 1,116 Bytes
acaeaf3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
# FVG-Delta Forex Signal Engine v6.0 — Hugging Face Spaces / container entrypoint.

set -euo pipefail

if [[ -n "${HF_SPACE:-}" ]]; then
    echo "[HF Space] Running in Hugging Face Space"
    export PORT="${PORT:-7860}"
fi

# Telegram credentials are recommended (Stage 3/4 alerts). The UI runs without
# them — alerts are skipped and logged, and still appear in the dashboard feed.
if [[ -z "${TELEGRAM_BOT_TOKEN:-}" || -z "${TELEGRAM_CHAT_ID:-}" ]]; then
    echo "=============================================="
    echo "  Telegram not configured (alerts will be skipped)"
    echo "=============================================="
    echo "Add these as Space secrets to enable Stage 3/4 alerts:"
    echo "  - TELEGRAM_BOT_TOKEN"
    echo "  - TELEGRAM_CHAT_ID"
    echo "Optional: LEVERAGE (default 500), LOT_SIZE (default 0.01)."
    echo "Restart the Space after adding them."
    echo "=============================================="
fi

python -m pip install --upgrade pip -q &

cd /app
python preflight_check.py || true

exec uvicorn app:app --host 0.0.0.0 --port "${PORT:-7860}"