mirror of
https://github.com/RYDE-WORK/lnp_ml.git
synced 2026-10-01 13:25:46 +08:00
63 lines
1.7 KiB
YAML
63 lines
1.7 KiB
YAML
services:
|
|
# FastAPI 后端服务
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: api
|
|
container_name: lnp-api
|
|
ports:
|
|
# 仅绑定本机,供服务器上的冒烟测试使用,不直接暴露到公网。
|
|
- "127.0.0.1:${API_PORT:-18000}:8000"
|
|
environment:
|
|
- MODEL_PATH=/app/models/final/model.pt
|
|
- RAG_POOL_CSV=/app/data/interim/internal.csv
|
|
# 7B LLM 内部微批;外层批量筛选仍可一次提交更多条。
|
|
- LLM_INFERENCE_BATCH_SIZE=${LLM_INFERENCE_BATCH_SIZE:-4}
|
|
volumes:
|
|
# 权重和 RAG 数据不进镜像,服务器上需预先放到这些路径。
|
|
- ./models/final:/app/models/final:ro
|
|
- ./models/mpnn:/app/models/mpnn:ro
|
|
- ./models/qwen2.5-7b-instruct:/app/models/qwen2.5-7b-instruct:ro
|
|
- ./data/interim/internal.csv:/app/data/interim/internal.csv:ro
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
|
|
# Streamlit 前端服务
|
|
streamlit:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: streamlit
|
|
container_name: lnp-streamlit
|
|
ports:
|
|
- "18501:8501"
|
|
environment:
|
|
- API_URL=http://api:8000
|
|
depends_on:
|
|
api:
|
|
condition: service_started
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8501/_stcore/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
|
|
networks:
|
|
default:
|
|
name: lnp-network
|