Skip to content

Commit

Permalink
update README.md add meilisearch ui managing describe
Browse files Browse the repository at this point in the history
  • Loading branch information
alimy committed Jun 24, 2022
1 parent 640ad04 commit 72604a2
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 21 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
data
.vscode
release
*Dockerfile*
web/node_modules
web/src-tauri/target
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ PaoPao主要由以下优秀的开源项目/工具构建
docker build -t your/paopao-ce:tag .
# 内嵌web ui并且自定义API host参数
docker build -t your/paopao-ce:tag --build-arg API_HOST=http://paopao.info .
docker build -t your/paopao-ce:tag --build-arg API_HOST=http://api.paopao.info .
# 内嵌web ui并且使用本地web/.env中的API host
docker build -t your/paopao-ce:tag --build-arg USE_API_HOST=no .
Expand Down Expand Up @@ -198,7 +198,7 @@ PaoPao主要由以下优秀的开源项目/工具构建
```sh
git clone https://github.com/rocboss/paopao-ce.git
docker compose up --build
# visit paopao-ce(http://127.0.0.1:8008) and phpMysqlAdmin(http://127.0.0.1:8080)
# visit paopao-ce(http://127.0.0.1:8008) and phpMyadmin(http://127.0.0.1:8080)
```

默认是使用config.yaml.sample的配置,如果需要自定义配置,请拷贝默认配置文件(比如config.yaml),修改后再同步配置到docker-compose.yaml如下:
Expand Down Expand Up @@ -311,7 +311,7 @@ release/paopao-ce --no-default-features --features sqlite3,localoss,loggerfile,r
`Sms`功能如果没有开启,任意短信验证码都可以绑定手机;

### 搭建依赖环境
#### [Zinc](https://github.com/zinclabs/zinc)搜索引擎:
#### [Zinc](https://github.com/zinclabs/zinc) 搜索引擎:
* Zinc运行
```sh
# 创建用于存放zinc数据的目录
Expand All @@ -328,6 +328,7 @@ CONTAINER ID IMAGE COMMAND CRE

# 使用docker compose运行
docker compose up -d zinc
# visit http://localhost:4080 打开自带的ui管理界面
```

* 修改Zinc配置
Expand All @@ -351,21 +352,31 @@ Zinc: # Zinc搜索配置
Secure: False
```
#### [Meilisearch](https://github.com/meilisearch/meilisearch)搜索引擎:
#### [Meilisearch](https://github.com/meilisearch/meilisearch) 搜索引擎:
* Meili运行
```sh
mkdir -p data/meili/data

# 使用Docker运行
docker run -d --name meili -v ${PWD}/data/meili/data:/meili_data -p 7700:7700 -e MEILI_MASTER_KEY=paopao-meilisearch getmeili/meilisearch:v0.27.0
# visit http://localhost:7700 打开自带的搜索前端ui

# 使用docker compose运行, 需要删除docker-compose.yaml中关于meili的注释
# 使用docker compose运行,需要删除docker-compose.yaml中关于meili的注释
docker compose up -d meili

# 使用docker运行meilisearch的ui管理前端
docker run -d --name uirecord -p 7701:3000 bitriory/uirecord
# visit http://localhost:7701

# 使用docker compose运行meilisearch的ui管理前端,需要删除docker-compose.yaml中关于uirecord的注释
docker compose up -d uirecord
# visit http://loclahost:7701

# 查看meili运行状态
docker compose ps
NAME COMMAND SERVICE STATUS PORTS
paopao-ce-meili-1 "tini -- /bin/sh -c …" meili running 0.0.0.0:7700->7700/tcp
NAME COMMAND SERVICE STATUS PORTS
paopao-ce-meili-1 "tini -- /bin/sh -c …" meili running 0.0.0.0:7700->7700/tcp
paopao-ce-uirecord-1 "docker-entrypoint.s…" uirecord running 0.0.0.0:7701->3000/tcp
```

* 修改Meili配置
Expand All @@ -383,13 +394,13 @@ LoggerMeili: # 使用Meili写日志
MaxLogBuffer: 100 # 最大log缓存条数, 设置范围[10, 10000], 默认100
...
Meili: # Meili搜索配置
Host: 127.0.0.1:7700 # 这里的host就是paopao-ce能访问到的zinc主机
Host: 127.0.0.1:7700 # 这里的host就是paopao-ce能访问到的meili主机
Index: paopao-data
ApiKey: paopao-meilisearch
Secure: False # 如果使用https访问meili就设置为True
```
#### [MinIO](https://github.com/minio/minio)对象存储服务
#### [MinIO](https://github.com/minio/minio) 对象存储服务
* MinIO运行
```sh
mkdir -p data/minio/data
Expand Down
21 changes: 15 additions & 6 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ services:
# MINIO_ROOT_PASSWORD: minio-root-password
# MINIO_DEFAULT_BUCKETS: paopao:public
# ports:
# - 127.0.0.1:9000:9000
# - 127.0.0.1:9001:9001
# - 9000:9000
# - 9001:9001
# volumes:
# - ./data/minio/data:/data
# networks:
Expand All @@ -36,7 +36,7 @@ services:
image: redis:7.0-alpine
restart: always
ports:
- 127.0.0.1::6379
- 6379:6379
networks:
- paopao-network

Expand All @@ -45,7 +45,7 @@ services:
user: root
restart: always
ports:
- 127.0.0.1::4080
- 4080:4080
volumes:
- ./data/zinc/data:/data
environment:
Expand All @@ -66,13 +66,22 @@ services:
# - MEILI_MASTER_KEY=paopao-meilisearch
# networks:
# - paopao-network

# # a ui for managing your meilisearch instances
# uirecord:
# image: bitriory/uirecord:latest
# restart: always
# ports:
# - 7701:3000
# networks:
# - paopao-network

phpmyadmin:
image: phpmyadmin:5.2
depends_on:
- db
ports:
- 127.0.0.1:8080:80
- 8080:80
environment:
- PMA_HOST=db
- PMA_USER=paopao
Expand All @@ -93,7 +102,7 @@ services:
- ./config.yaml.sample:/app/paopao-ce/config.yaml
- ./data/paopao-ce/data:/app/paopao-ce/data
ports:
- 127.0.0.1:8008:8008
- 8008:8008
networks:
- paopao-network

Expand Down
7 changes: 1 addition & 6 deletions internal/conf/logger_meili.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,9 @@ func newMeiliLogHook() *meiliLogHook {
Uid: hook.idxName,
PrimaryKey: "id",
})
rankingRules := []string{
"message",
"time:desc",
}
sortableAttributes := []string{
"time:desc",
"time",
}
index.UpdateRankingRules(&rankingRules)
index.UpdateSortableAttributes(&sortableAttributes)
}

Expand Down
3 changes: 3 additions & 0 deletions web/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
components.d.ts
*Dockerfile*
node_modules

0 comments on commit 72604a2

Please sign in to comment.