forked from lobehub/lobe-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/lobehub/lobe-chat
- Loading branch information
Showing
7 changed files
with
146 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,26 +32,35 @@ Here is the process for deploying the LobeChat server database version on a Linu | |
|
||
### Create a Postgres Database Instance | ||
|
||
Create a Postgres database instance according to your needs, for example: | ||
Please create a Postgres database instance with the PGVector plugin according to your needs, for example: | ||
|
||
```sh | ||
docker run --name my-postgres --network pg -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres | ||
docker network create pg | ||
|
||
docker run --name my-postgres --network pg -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d pgvector/pgvector:pg16 | ||
``` | ||
|
||
<Callout type="warning"> | ||
The above command is only for testing/demonstration purposes because this pg instance does not include a persistent part. | ||
The above command will create a PG instance named `my-postgres` on the network `pg`, where `pgvector/pgvector:pg16` is a Postgres 16 image with the pgvector plugin installed by default. | ||
|
||
<Callout type="info"> | ||
The pgvector plugin provides vector search capabilities for Postgres, which is an important component for LobeChat to implement RAG. | ||
</Callout> | ||
|
||
The above command will create a PG instance named `my-postgres` on the network `pg`. | ||
<Callout type="warning"> | ||
The above command does not specify a persistent storage location for the pg instance, so it is only for testing/demonstration purposes. Please configure persistent storage for production environments. | ||
</Callout> | ||
|
||
### Create a file named `lobe-chat.env` to store environment variables: | ||
|
||
```shell | ||
# DB required | ||
# Website domain | ||
APP_URL=https://your-prod-domain.com | ||
|
||
# DB required environment variables | ||
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= | ||
DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres | ||
|
||
# NEXT_AUTH related | ||
# NEXT_AUTH related, can use auth0, Azure AD, GitHub, Authentik, zitadel, etc. If you have other access requirements, feel free to submit a PR | ||
NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 | ||
NEXT_AUTH_SSO_PROVIDERS=auth0 | ||
NEXTAUTH_URL=https://your-prod-domain.com/api/auth | ||
|
@@ -103,20 +112,21 @@ The script command you need to execute is: | |
|
||
```shell | ||
$ docker run -it -d --name lobe-chat-database -p 3210:3210 \ | ||
-e DATABASE_URL=postgres://postgres:[email protected]:5432/postgres \ | ||
-e KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= \ | ||
-e NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 \ | ||
-e NEXT_AUTH_SSO_PROVIDERS=auth0 \ | ||
-e AUTH0_CLIENT_ID=xxxxxx \ | ||
-e AUTH0_CLIENT_SECRET=cSX_xxxxx \ | ||
-e AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com \ | ||
-e NEXTAUTH_URL=http://localhost:3210/api/auth \ | ||
-e S3_ACCESS_KEY_ID=xxxxxxxxxx \ | ||
-e S3_SECRET_ACCESS_KEY=xxxxxxxxxx \ | ||
-e S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com \ | ||
-e S3_BUCKET=lobechat \ | ||
-e NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com \ | ||
lobehub/lobe-chat-database | ||
-e DATABASE_URL=postgres://postgres:[email protected]:5432/postgres \ | ||
-e KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= \ | ||
-e NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 \ | ||
-e NEXT_AUTH_SSO_PROVIDERS=auth0 \ | ||
-e AUTH0_CLIENT_ID=xxxxxx \ | ||
-e AUTH0_CLIENT_SECRET=cSX_xxxxx \ | ||
-e AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com \ | ||
-e APP_URL=http://localhost:3210 \ | ||
-e NEXTAUTH_URL=http://localhost:3210/api/auth \ | ||
-e S3_ACCESS_KEY_ID=xxxxxxxxxx \ | ||
-e S3_SECRET_ACCESS_KEY=xxxxxxxxxx \ | ||
-e S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com \ | ||
-e S3_BUCKET=lobechat \ | ||
-e NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com \ | ||
lobehub/lobe-chat-database | ||
``` | ||
|
||
<Callout type="tip"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters