mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-02 01:27:24 -04:00
Implement automatic detection of custom_config.json for simpler Docker usage. No environment variables or command-line arguments needed for most users. Changes: - entrypoint.sh: Add smart config detection (custom_config.json > CLI arg > default_config.json) - docker-compose.yml: Add configs volume mount for editing without rebuilds - docs/DOCKER.md: Update documentation with simplified workflow - .gitignore: Add custom_config.json to prevent accidental commits Usage: cp configs/default_config.json configs/custom_config.json nano configs/custom_config.json docker-compose up # Automatically uses custom_config.json Simplifies user experience by following convention over configuration principle.
39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
services:
|
|
ai-trader:
|
|
image: ghcr.io/xe138/ai-trader:latest
|
|
# Uncomment to build locally instead of pulling:
|
|
# build: .
|
|
container_name: ai-trader-app
|
|
volumes:
|
|
- ./data:/app/data
|
|
- ./logs:/app/logs
|
|
- ./configs:/app/configs
|
|
environment:
|
|
# AI Model API Configuration
|
|
- OPENAI_API_BASE=${OPENAI_API_BASE}
|
|
- OPENAI_API_KEY=${OPENAI_API_KEY}
|
|
|
|
# Data Source Configuration
|
|
- ALPHAADVANTAGE_API_KEY=${ALPHAADVANTAGE_API_KEY}
|
|
- JINA_API_KEY=${JINA_API_KEY}
|
|
|
|
# System Configuration
|
|
- RUNTIME_ENV_PATH=/app/data/runtime_env.json
|
|
|
|
# MCP Service Ports (fixed internally)
|
|
- MATH_HTTP_PORT=8000
|
|
- SEARCH_HTTP_PORT=8001
|
|
- TRADE_HTTP_PORT=8002
|
|
- GETPRICE_HTTP_PORT=8003
|
|
|
|
# Agent Configuration
|
|
- AGENT_MAX_STEP=${AGENT_MAX_STEP:-30}
|
|
ports:
|
|
# Format: "HOST:CONTAINER" - container ports are fixed, host ports configurable via .env
|
|
- "${MATH_HTTP_PORT:-8000}:8000"
|
|
- "${SEARCH_HTTP_PORT:-8001}:8001"
|
|
- "${TRADE_HTTP_PORT:-8002}:8002"
|
|
- "${GETPRICE_HTTP_PORT:-8003}:8003"
|
|
- "${WEB_HTTP_PORT:-8888}:8888"
|
|
restart: on-failure:3 # Restart max 3 times on failure, prevents endless loops
|