mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-02 09:37:23 -04:00
Compare commits
2 Commits
v0.2.0-alp
...
v0.2.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
| 55206549c7 | |||
| 9e05ce0891 |
@@ -30,3 +30,9 @@ WEB_HTTP_PORT=8888
|
||||
|
||||
# Agent Configuration
|
||||
AGENT_MAX_STEP=30
|
||||
|
||||
# Data Volume Configuration
|
||||
# Base directory for all persistent data (will contain data/, logs/, configs/ subdirectories)
|
||||
# Use relative paths (./volumes) or absolute paths (/home/user/ai-trader-volumes)
|
||||
# Defaults to current directory (.) if not set
|
||||
VOLUME_PATH=.
|
||||
|
||||
@@ -5,9 +5,9 @@ services:
|
||||
# build: .
|
||||
container_name: ai-trader-app
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
- ./logs:/app/logs
|
||||
- ./configs:/app/configs
|
||||
- ${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}
|
||||
|
||||
@@ -112,17 +112,43 @@ docker-compose up
|
||||
|
||||
### Volume Mounts
|
||||
|
||||
Docker Compose mounts three volumes:
|
||||
Docker Compose mounts three volumes for persistent data. By default, these are stored in the project directory:
|
||||
|
||||
- `./data:/app/data` - Price data and trading records
|
||||
- `./logs:/app/logs` - MCP service logs
|
||||
- `./configs:/app/configs` - Configuration files (allows editing configs without rebuilding)
|
||||
|
||||
Data persists across container restarts. To reset:
|
||||
### Custom Volume Location
|
||||
|
||||
You can change where data is stored by setting `VOLUME_PATH` in your `.env` file:
|
||||
|
||||
```bash
|
||||
# Store data in a different location
|
||||
VOLUME_PATH=/home/user/trading-data
|
||||
|
||||
# Or use a relative path
|
||||
VOLUME_PATH=./volumes
|
||||
```
|
||||
|
||||
This will store data in:
|
||||
- `/home/user/trading-data/data/`
|
||||
- `/home/user/trading-data/logs/`
|
||||
- `/home/user/trading-data/configs/`
|
||||
|
||||
**Note:** The directory structure is automatically created. You'll need to copy your existing configs:
|
||||
```bash
|
||||
# After changing VOLUME_PATH
|
||||
mkdir -p /home/user/trading-data/configs
|
||||
cp configs/custom_config.json /home/user/trading-data/configs/
|
||||
```
|
||||
|
||||
### Reset Data
|
||||
|
||||
To reset all trading data:
|
||||
|
||||
```bash
|
||||
docker-compose down
|
||||
rm -rf data/agent_data/* logs/*
|
||||
rm -rf ${VOLUME_PATH:-.}/data/agent_data/* ${VOLUME_PATH:-.}/logs/*
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
|
||||
@@ -38,12 +38,18 @@ fi
|
||||
echo "✅ Environment variables validated"
|
||||
|
||||
# Step 1: Data preparation
|
||||
echo "📊 Fetching and merging price data..."
|
||||
# Run scripts from /app/scripts but output to /app/data
|
||||
cd /app/data
|
||||
python /app/scripts/get_daily_price.py
|
||||
python /app/scripts/merge_jsonl.py
|
||||
cd /app
|
||||
echo "📊 Checking price data..."
|
||||
if [ -f "/app/data/merged.jsonl" ] && [ -s "/app/data/merged.jsonl" ]; then
|
||||
echo "✅ Using existing price data ($(wc -l < /app/data/merged.jsonl) stocks)"
|
||||
echo " To refresh data, delete /app/data/merged.jsonl and restart"
|
||||
else
|
||||
echo "📊 Fetching and merging price data..."
|
||||
# Run scripts from /app/scripts but output to /app/data
|
||||
cd /app/data
|
||||
python /app/scripts/get_daily_price.py
|
||||
python /app/scripts/merge_jsonl.py
|
||||
cd /app
|
||||
fi
|
||||
|
||||
# Step 2: Start MCP services in background
|
||||
echo "🔧 Starting MCP services..."
|
||||
|
||||
Reference in New Issue
Block a user