Files
crypto_trading/docker-compose.local.yml
matitos 2ca5032e7e Notification upgrades: lifecycle, configurable levels, summaries
- NOTIFY_LEVELS chooses which event levels are sent (default trade,error).
- NOTIFY_LIFECYCLE sends explicit start/stop messages; the kill switch always
  notifies at error level.
- SUMMARY_INTERVAL_MINUTES sends a periodic portfolio summary (equity, per
  strategy P&L, allocation, halted state) via a background task started with
  the run and stopped on stop/kill/shutdown.
- Wires the new vars plus the go-live vars through both compose files and the
  deploy workflow. Adds tests.
2026-09-22 13:18:02 +00:00

61 lines
2.0 KiB
YAML

# Local / self-contained stack: no Traefik, publishes ports directly.
# Usage: docker compose -f docker-compose.local.yml up --build
# Dashboard: http://localhost:8080 API docs: http://localhost:8000/docs
name: crypto_trading_local
services:
backend:
build:
context: ./backend
args:
BUILD_VERSION: ${BUILD_VERSION:-unknown}
container_name: crypto-trading-backend-local
restart: unless-stopped
environment:
- MODE=${MODE:-paper}
- EXCHANGE=${EXCHANGE:-binance}
- SYMBOL=${SYMBOL:-BTC/USDT}
- TIMEFRAME=${TIMEFRAME:-5m}
- POLL_INTERVAL=${POLL_INTERVAL:-5}
- STARTING_BALANCE=${STARTING_BALANCE:-10000}
- FEE_BPS=${FEE_BPS:-10}
- SLIPPAGE_BPS=${SLIPPAGE_BPS:-5}
- DATABASE_URL=sqlite:////data/trader.db
- CORS_ORIGINS=*
- EXCHANGE_API_KEY=${EXCHANGE_API_KEY:-}
- EXCHANGE_API_SECRET=${EXCHANGE_API_SECRET:-}
- EXCHANGE_SANDBOX=${EXCHANGE_SANDBOX:-false}
- MAX_DAILY_LOSS=${MAX_DAILY_LOSS:-0}
- MAX_DRAWDOWN_PCT=${MAX_DRAWDOWN_PCT:-0}
- MAX_POSITION_PCT=${MAX_POSITION_PCT:-1.0}
- MAX_TRADES_PER_DAY=${MAX_TRADES_PER_DAY:-0}
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN:-}
- TELEGRAM_CHAT_ID=${TELEGRAM_CHAT_ID:-}
- NOTIFY_WEBHOOK_URL=${NOTIFY_WEBHOOK_URL:-}
- NOTIFY_LEVELS=${NOTIFY_LEVELS:-trade,error}
- NOTIFY_LIFECYCLE=${NOTIFY_LIFECYCLE:-true}
- SUMMARY_INTERVAL_MINUTES=${SUMMARY_INTERVAL_MINUTES:-0}
- LIVE_CONFIRMATION=${LIVE_CONFIRMATION:-}
- MIN_LIVE_BALANCE=${MIN_LIVE_BALANCE:-100}
- API_TOKEN=${API_TOKEN:-}
- API_TOKEN_HEADER=${API_TOKEN_HEADER:-X-API-Token}
volumes:
- ./data:/data
ports:
- "8000:8000"
frontend:
build:
context: ./frontend
args:
BUILD_VERSION: ${BUILD_VERSION:-unknown}
container_name: crypto-trader-frontend-local
restart: unless-stopped
depends_on:
- backend
environment:
- API_TOKEN=${API_TOKEN:-}
- API_TOKEN_HEADER=${API_TOKEN_HEADER:-X-API-Token}
ports:
- "8080:80"