mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-01 17:17:24 -04:00
The API_PORT variable was incorrectly included in the container's
environment section. It should only be used for host port mapping
in docker-compose.yml, not passed into the container.
Changes:
- Remove API_PORT from environment section in docker-compose.yml
- Container always uses port 8080 internally (hardcoded in entrypoint.sh)
- API_PORT in .env/.env.example only controls the host-side mapping:
ports: "${API_PORT:-8080}:8080" (host:container)
Why this matters:
- Prevents confusion about whether API_PORT changes internal port
- Clarifies that entrypoint.sh hardcodes --port 8080
- Simplifies container environment (one less unused variable)
- More explicit about the port mapping behavior
No functional change - the container was already ignoring this variable.
46 lines
1.4 KiB
YAML
46 lines
1.4 KiB
YAML
services:
|
|
# REST API server for Windmill integration
|
|
ai-trader:
|
|
# image: ghcr.io/xe138/ai-trader:latest
|
|
# Uncomment to build locally instead of pulling:
|
|
build: .
|
|
container_name: ai-trader
|
|
volumes:
|
|
- ${VOLUME_PATH:-.}/data:/app/data
|
|
- ${VOLUME_PATH:-.}/logs:/app/logs
|
|
- ${VOLUME_PATH:-.}/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}
|
|
|
|
# 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:
|
|
# MCP service ports (internal)
|
|
- "${MATH_HTTP_PORT:-8000}:8000"
|
|
- "${SEARCH_HTTP_PORT:-8001}:8001"
|
|
- "${TRADE_HTTP_PORT:-8002}:8002"
|
|
- "${GETPRICE_HTTP_PORT:-8003}:8003"
|
|
# API server port (primary interface)
|
|
- "${API_PORT:-8080}:8080"
|
|
# Web dashboard
|
|
- "${WEB_HTTP_PORT:-8888}:8888"
|
|
restart: unless-stopped # Keep API server running
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|