docs: 更新镜像构建部分说明

This commit is contained in:
2026-04-10 12:59:50 +08:00
parent 0f9e5c5049
commit 6831a15424
2 changed files with 48 additions and 0 deletions
+24
View File
@@ -84,6 +84,30 @@ python scripts/tools/train.py \
python scripts/tools/generate.py --param_path=/path/to/param_path
```
#### Docker
Build and run with Docker (recommended for GPU environments):
```bash
# Build image
docker build -t astrai:latest .
# Run with GPU support
docker run --gpus all -it astrai:latest
# Run with specific GPUs
docker run --gpus '"device=0,1"' -it astrai:latest
# Run inference server
docker run --gpus all -p 8000:8000 astrai:latest \
python -m scripts.tools.server --port 8000 --device cuda
# Run with volume mount for data
docker run --gpus all -v /path/to/data:/data -it astrai:latest
```
> **Note**: `--gpus all` is required for CUDA support. Without it, `torch.cuda.is_available()` will return `False`.
#### Start HTTP Server
Start the inference server with OpenAI-compatible HTTP API: