forked from lobehub/lobe-chat
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📝 docs: Docker compose for local. (lobehub#3651)
- Loading branch information
1 parent
6e202a6
commit cef1733
Showing
8 changed files
with
414 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# LobeChat domain | ||
APP_URL=https://localhost:3210 | ||
|
||
# Postgres related, which are the necessary environment variables for DB | ||
# Key used to encrypt sensitive information; can be generated using openssl rand -base64 32 | ||
KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ= | ||
# Postgres database connection string | ||
# Format: postgres://username:password@host:port/dbname; if your pg instance is a Docker container, use the container name | ||
DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/postgres | ||
|
||
# NEXT_AUTH related; can use auth0, Azure AD, GitHub, Authentik, Zitadel, Logto, etc. If you have other integration requests, feel free to submit a PR. | ||
# Here we take Logto as an example | ||
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg | ||
NEXT_AUTH_SSO_PROVIDERS=logto | ||
NEXTAUTH_URL=http://localhost:3210/api/auth | ||
LOGTO_CLIENT_ID=YOUR_LOGTO_CLIENT_ID | ||
LOGTO_CLIENT_SECRET=YOUR_LOGTO_CLIENT_SECRET | ||
LOGTO_ISSUER=http://localhost:3001/oidc | ||
# Note: If you have ACCESS_CODE, be sure to clear it. We use NEXT_AUTH as the only authentication source. | ||
# Proxy, if you need it (e.g., if you use GitHub as an authentication service provider) | ||
# HTTP_PROXY=http://localhost:7890 | ||
# HTTPS_PROXY=http://localhost:7890 | ||
|
||
# MinIO S3 configuration | ||
S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID # Invalid until manually created in MinIO UI | ||
S3_SECRET_ACCESS_KEY=YOUR_S3_SECRET_ACCESS_KEY # Invalid until manually created in MinIO UI | ||
S3_ENDPOINT=http://localhost:9000 | ||
S3_BUCKET=lobe # Invalid until manually created in MinIO UI | ||
S3_ENDPOINT=http://localhost:9000 | ||
S3_ENABLE_PATH_STYLE=1 | ||
|
||
# Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE. | ||
# OPEANAI_API_KEY=sk-xxxx | ||
# OPENAI_PROXY_URL=https://api.openai.com/v1 | ||
# OPENAI_MODEL_LIST=... |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# LobeChat 域名 | ||
APP_URL=https://localhost:3210 | ||
|
||
# Postgres 相关,也即 DB 必须的环境变量 | ||
# 用于加密敏感信息的密钥,可以使用 openssl rand -base64 32 生成 | ||
KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ= | ||
# Postgres 数据库连接字符串 | ||
# 格式:postgres://username:password@host:port/dbname,如果你的 pg 实例与 LobeChat 服务在同一 Docker 网络中,可以使用容器名作为 host | ||
DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@localhost:5432/postgres | ||
|
||
# NEXT_AUTH 相关,可以使用 auth0、Azure AD、GitHub、Authentik、Zitadel、Logto 等,如有其他接入诉求欢迎提 PR | ||
# 这里以 Logto 为例 | ||
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg | ||
NEXT_AUTH_SSO_PROVIDERS=logto | ||
NEXTAUTH_URL=http://localhost:3210/api/auth | ||
LOGTO_CLIENT_ID=YOUR_LOGTO_CLIENT_ID | ||
LOGTO_CLIENT_SECRET=YOUR_LOGTO_CLIENT_SECRET | ||
LOGTO_ISSUER=http://localhost:3001/oidc | ||
# 注:如果你有 ACCESS_CODE,请务必清空,我们以 NEXT_AUTH 作为唯一鉴权来源 | ||
# Proxy,如果你需要的话(比如你使用 GitHub 作为鉴权服务提供商) | ||
# HTTP_PROXY=http://localhost:7890 | ||
# HTTPS_PROXY=http://localhost:7890 | ||
|
||
# MinIO S3 配置 | ||
S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID # 直到在 MinIO UI 中手动创建之前都是无效的 | ||
S3_SECRET_ACCESS_KEY=YOUR_S3_SECRET_ACCESS_KEY # 直到在 MinIO UI 中手动创建之前都是无效的 | ||
S3_ENDPOINT=http://localhost:9000 | ||
S3_BUCKET=lobe # 直到在 MinIO UI 中手动创建之前都是无效的 | ||
S3_PUBLIC_DOMAIN=http://localhost:9000 | ||
S3_ENABLE_PATH_STYLE=1 | ||
|
||
# 其他环境变量,视需求而定,可以参照客户端版本的环境变量配置,注意不要有 ACCESS_CODE | ||
# OPEANAI_API_KEY=sk-xxxx | ||
# OPENAI_PROXY_URL=https://api.openai.com/v1 | ||
# OPENAI_MODEL_LIST=... |
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
services: | ||
postgresql: | ||
image: pgvector/pgvector:pg16 | ||
container_name: lobe-postgres | ||
network_mode: 'host' | ||
volumes: | ||
- './data:/var/lib/postgresql/data' | ||
environment: | ||
- 'POSTGRES_DB=lobe' | ||
- 'POSTGRES_PASSWORD=uWNZugjBqixf8dxC' | ||
healthcheck: | ||
test: ['CMD-SHELL', 'pg_isready -U postgres'] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
restart: always | ||
|
||
minio: | ||
image: minio/minio | ||
container_name: lobe-minio | ||
network_mode: 'host' | ||
volumes: | ||
- './s3_data:/etc/minio/data' | ||
environment: | ||
- 'MINIO_ROOT_USER=YOUR_MINIO_USER' | ||
- 'MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD' | ||
- 'MINIO_DOMAIN=localhost:9000' | ||
- 'MINIO_API_CORS_ALLOW_ORIGIN=http://localhost:3210' | ||
restart: always | ||
command: > | ||
server /etc/minio/data --address ":9000" --console-address ":9001" | ||
logto: | ||
image: svhd/logto | ||
container_name: lobe-logto | ||
network_mode: 'host' | ||
depends_on: | ||
postgresql: | ||
condition: service_healthy | ||
environment: | ||
- 'TRUST_PROXY_HEADER=1' | ||
- 'DB_URL=postgresql://postgres:uWNZugjBqixf8dxC@localhost:5432/logto' | ||
- 'ENDPOINT=http://localhost:3001' | ||
- 'ADMIN_ENDPOINT=http://localhost:3002' | ||
entrypoint: ['sh', '-c', 'npm run cli db seed -- --swe && npm start'] | ||
|
||
lobe: | ||
image: lobehub/lobe-chat-database | ||
container_name: lobe-database | ||
network_mode: 'host' | ||
depends_on: | ||
- postgresql | ||
- minio | ||
- logto | ||
env_file: | ||
- .env | ||
restart: always | ||
|
||
volumes: | ||
data: | ||
driver: local | ||
s3_data: | ||
driver: local |
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
File renamed without changes.
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
Oops, something went wrong.