mirror of
https://github.com/simonlin1212/TradingAgents-astock.git
synced 2026-08-31 01:23:38 +00:00
镜像 ENTRYPOINT 只有 CLI,compose 里没有任何 Web UI 服务,用户要在容器里 跑看板只能自己拼命令,常写成依赖 CWD 的 `streamlit run web/app.py`,工作 目录不对就报 File does not exist(issue #82)。 - compose 新增 web 服务:entrypoint 用 tradingagents-web(web.launch:main 按 __file__ 解析 app.py 绝对路径,与 CWD 无关),映射 8501 - 通过 STREAMLIT_SERVER_ADDRESS=0.0.0.0 让容器内监听全地址,否则端口映射进不来 (已实测 streamlit config show 确认三个环境变量均生效) - README FAQ 增加对应条目 Reported-by: @Labear33
57 lines
1.4 KiB
YAML
57 lines
1.4 KiB
YAML
services:
|
||
# CLI(默认):docker compose run --rm tradingagents
|
||
tradingagents:
|
||
build: .
|
||
env_file:
|
||
- .env
|
||
volumes:
|
||
- tradingagents_data:/home/appuser/.tradingagents
|
||
tty: true
|
||
stdin_open: true
|
||
|
||
# Web UI:docker compose up web → http://localhost:8501
|
||
#
|
||
# 入口用 `tradingagents-web`(= web.launch:main),它按 __file__ 解析 app.py 的
|
||
# 绝对路径,与工作目录无关。不要写成 `streamlit run web/app.py`——那条依赖 CWD,
|
||
# 一旦工作目录不对就报 "File does not exist: web/app.py"(issue #82)。
|
||
web:
|
||
build: .
|
||
entrypoint: ["tradingagents-web"]
|
||
env_file:
|
||
- .env
|
||
environment:
|
||
# 容器内必须监听 0.0.0.0,否则端口映射进不来
|
||
- STREAMLIT_SERVER_ADDRESS=0.0.0.0
|
||
- STREAMLIT_SERVER_PORT=8501
|
||
- STREAMLIT_SERVER_HEADLESS=true
|
||
ports:
|
||
- "8501:8501"
|
||
volumes:
|
||
- tradingagents_data:/home/appuser/.tradingagents
|
||
|
||
ollama:
|
||
image: ollama/ollama:latest
|
||
volumes:
|
||
- ollama_data:/root/.ollama
|
||
profiles:
|
||
- ollama
|
||
|
||
tradingagents-ollama:
|
||
build: .
|
||
env_file:
|
||
- .env
|
||
environment:
|
||
- LLM_PROVIDER=ollama
|
||
volumes:
|
||
- tradingagents_data:/home/appuser/.tradingagents
|
||
depends_on:
|
||
- ollama
|
||
tty: true
|
||
stdin_open: true
|
||
profiles:
|
||
- ollama
|
||
|
||
volumes:
|
||
tradingagents_data:
|
||
ollama_data:
|