From edafe63e29a618d06f20d1d1276b343f200d0d16 Mon Sep 17 00:00:00 2001 From: zhaoxi Date: Wed, 29 Apr 2026 10:02:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20workflow=5Ftemplate=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=8F=AF=E4=B8=8D=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 1 + Dockerfile | 1 + README.md | 67 ++++++++++++++++++++++++++++++++++++++++++++-- docker-compose.yml | 4 +-- 4 files changed, 69 insertions(+), 4 deletions(-) diff --git a/.dockerignore b/.dockerignore index 4787789..e11a476 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,3 +8,4 @@ frontend/dist docker-compose.yml .env .env.example +.idea \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 1c0e97c..80e805e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,7 @@ WORKDIR /app RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ libpq-dev \ + git \ && rm -rf /var/lib/apt/lists/* # Install uv package manager diff --git a/README.md b/README.md index 5fd0266..f60f265 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,69 @@ | **pretor-pioneer** | **先驱者** | **知识增强**:RAG 检索增强引擎,管理私有知识库的向量化、索引与精准检索。 | 📅 规划中 | --- -## 快速开始 -本项目正在开发中... +## 🚀 快速开始 (Quick Start) +> **当前版本**:`v0.1.0-alpha` (开发预览版) +> 本项目目前处于快速迭代阶段,欢迎提交 Issue 或 Pull Request。 + +### 方式一:使用 Docker Compose (推荐) +这是部署 **Pretor 应用** 及其配套 **PostgreSQL 数据库** 最简单、最完整的方式。 + +1. **准备配置文件**:在本地创建一个目录,并新建 `docker-compose.yml`: + ```yaml + services: + db: + image: postgres:16-alpine + container_name: pretor_db + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgrespassword + POSTGRES_DB: pretor + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres -d pretor"] + interval: 5s + timeout: 5s + retries: 5 + + pretor: + image: zhaoxi5699/pretor:v0.1.0alpha + container_name: pretor + ports: + - "8000:8000" + - "8265:8265" + depends_on: + db: + condition: service_healthy + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgrespassword + - POSTGRES_HOST=db + - POSTGRES_PORT=5432 + - POSTGRES_DB=pretor + - SECRET_KEY=changethiskey12345 # 请在生产环境中修改此密钥 + ``` + +2. **启动服务** + ```bash + docker compose up -d + ``` + +### 方式二:使用 Docker +1. **启动服务** + ```bash + docker run -d \ + --name pretor \ + -p 8000:8000 \ + -p 8265:8265 \ + -e POSTGRES_HOST=你的数据库IP \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgrespassword \ + -e POSTGRES_DB=pretor \ + -e SECRET_KEY=your_secret_key \ + zhaoxi5699/pretor:v0.1.0alpha + ``` + +## 🔍 访问与验证 +服务启动后,可以通过以下地址进行操作: +- Web 控制台 / API 文档: http://localhost:8000 +- Ray 任务仪表盘: http://localhost:8265 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 044c845..b5bf8c1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,9 +16,9 @@ services: timeout: 5s retries: 5 - app: + pretor: build: . - container_name: pretor_app + container_name: pretor ports: - "8000:8000" - "8265:8265"