feat: containerize for mmd.i80.dk deployment via Gitea/Nomad
Some checks failed
Build and Deploy MoneyMaker / build-and-deploy (push) Failing after 15s
Some checks failed
Build and Deploy MoneyMaker / build-and-deploy (push) Failing after 15s
- Add Dockerfile (python:3.12-slim, HF_HOME=/app/data/hf-cache) - Add mmd.nomad (multi-task: web=dashboard, worker=scheduler) - Add .gitea/workflows/deploy.yml (build->Harbor, deploy->Nomad) - Add scheduler.py (stdlib scheduler replaces cron in container) - Add requirements.txt - dashboard.py: LOG_DIR + PORT/HOST from env vars - saxo_auth.py: TOKEN_FILE from SAXO_TOKEN_FILE env var - .gitignore: proper ignores for container project Volume moneymaker-data (/app/data) holds: - logs/ (shared between web+worker) - .saxo_token.json (pre-copy once after first deploy) - hf-cache/ (HuggingFace FinBERT cache) Gitea secrets required: DATABASE_URL, ANTHROPIC_API_KEY, SAXO_APP_KEY, SAXO_APP_SECRET_1, HARBOR_ROBOT_TOKEN
This commit is contained in:
@@ -14,6 +14,7 @@ Auto-refreshes every 60 seconds. Shows:
|
||||
"""
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import time
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
@@ -25,7 +26,7 @@ from db import get_conn, DB_TYPE
|
||||
from report import _c25_day_return, _unrealised_pnl, _realised_pnl, _total_fees, _signal_accuracy
|
||||
|
||||
CAPITAL = 10_000
|
||||
LOG_DIR = Path(__file__).parent / "logs"
|
||||
LOG_DIR = Path(os.getenv("LOG_DIR", str(Path(__file__).parent / "logs")))
|
||||
REFRESH = 60 # seconds
|
||||
|
||||
app = Flask(__name__)
|
||||
@@ -316,10 +317,10 @@ def health():
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="MoneyMaker Dashboard")
|
||||
parser.add_argument("--port", type=int, default=5001)
|
||||
parser.add_argument("--host", default="0.0.0.0")
|
||||
parser.add_argument("--port", type=int, default=int(os.getenv("PORT", 5001)))
|
||||
parser.add_argument("--host", default=os.getenv("HOST", "0.0.0.0"))
|
||||
args = parser.parse_args()
|
||||
print(f"\n MoneyMaker Dashboard → http://localhost:{args.port}\n")
|
||||
print(f"\n MoneyMaker Dashboard -> http://localhost:{args.port}\n")
|
||||
app.run(host=args.host, port=args.port, debug=False)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user