deerflow-code/offline-backend-20260512/backend/DOCKER_OFFLINE.md
2026-09-07 18:24:55 +08:00

53 lines
1.5 KiB
Markdown

# Backend Docker Offline Deployment
Build once on an online Linux server:
```bash
cd offline-backend-20260512/backend
chmod +x build-backend-image.sh save-backend-image.sh start-backend-docker.sh
./build-backend-image.sh
./save-backend-image.sh
```
The build script defaults to Aliyun for apt packages and Tsinghua for Python packages:
```bash
APT_MIRROR=mirrors.aliyun.com \
UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple/ \
./build-backend-image.sh
```
The Docker build installs the pinned `requirements-offline.txt` with pip from
the configured Python mirror, so the dependency image contains the backend
runtime dependencies and can be moved to an offline machine.
Move `dist/deerflow-backend-offline.tar` plus this backend directory to the
offline machine, then load and start:
```bash
docker load -i deerflow-backend-offline.tar
./start-backend-docker.sh 8001
```
Useful overrides:
```bash
BACKEND_PORT=9001 ./start-backend-docker.sh
IMAGE_NAME=your-image:tag ./start-backend-docker.sh 9001
DATA_DIR=/data/deerflow-backend ./start-backend-docker.sh
```
The startup script bind-mounts these host paths:
- backend code: current backend directory -> `/app/backend`
- config: `docker-data/config/config.yaml`, `extensions_config.json`, `.env`
- agents and SQLite/runtime data: `docker-data/.deer-flow`
- skills: `docker-data/skills`
- logs: `docker-data/logs`
Edit files under `docker-data/` on the host, then restart the container:
```bash
docker restart deerflow-backend
```