Docker 本地开发
快速启动
# 1. 克隆代码
git clone https://github.com/radstudio/radstudio.git
cd radstudio
# 2. 初始化配置
./scripts/radstudioctl.py init
# 3. 启动(含基础设施)
./scripts/radstudioctl.py up
启动的服务
| 服务 | 端口 | 说明 |
|---|---|---|
frontend | 5173 | 用户前端 (Vite dev server, 热更新) |
admin | 8080 | 管理后台 |
backend | 8000 | FastAPI 后端 |
celery-worker | — | Celery 任务执行 |
postgres | 5432 | PostgreSQL 16 (--profile infra) |
redis | 6379 | Redis 7 (--profile infra) |
minio | 9000/9001 | 对象存储 (--profile infra) |
启用 Worker
# GPU Worker
./scripts/radstudioctl.py up --profile gpu
# CPU Worker
./scripts/radstudioctl.py up --profile cpu
常用命令
# 查看状态
./scripts/radstudioctl.py status
# 查看日志
./scripts/radstudioctl.py logs backend
./scripts/radstudioctl.py logs frontend
./scripts/radstudioctl.py logs celery-worker
# 重启单个服务
./scripts/radstudioctl.py restart backend
# 停止所有服务
./scripts/radstudioctl.py down
# 清理数据卷
./scripts/radstudioctl.py down -v
热更新
开发环境下,以下服务支持热更新:
- Frontend — Vite HMR,修改代码后自动刷新
- Backend — uvicorn
--reload,修改代码后自动重启 - Admin — Vite HMR
Compose 文件说明
| 文件 | 用途 |
|---|---|
deploy/docker-compose.yml | 基础服务定义 |
deploy/docker-compose.override.yml | 开发环境覆盖(自动加载) |
deploy/docker-compose.infra.yml | 基础设施(PG、Redis、Nginx) |
健康检查
# API 健康检查
curl `http://localhost:8000/health`
# → {"status":"healthy"}
# 前端访问
curl -I `http://localhost:5173`