chore(server): disable indexer on self-host by default (#12452)
enable indexer using `compose.indexer.yml` on self-host: ```bash docker compose -f compose.yml -f compose.indexer.yml up ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Updated the build process in the development container to include building the reader package. - Added and configured a Manticore Search indexer service in the development container. - Removed the indexer service and related environment variables from the self-hosted Docker Compose setup and environment example file. - **Documentation** - Improved documentation formatting for better readability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
cb88156188
commit
bd72c931c4
@ -6,6 +6,7 @@ yarn install
|
|||||||
|
|
||||||
# Build Server Dependencies
|
# Build Server Dependencies
|
||||||
yarn affine @affine/server-native build
|
yarn affine @affine/server-native build
|
||||||
|
yarn affine @affine/reader build
|
||||||
|
|
||||||
# Create database
|
# Create database
|
||||||
yarn affine @affine/server prisma migrate reset -f
|
yarn affine @affine/server prisma migrate reset -f
|
||||||
|
@ -10,6 +10,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
DATABASE_URL: postgresql://affine:affine@db:5432/affine
|
DATABASE_URL: postgresql://affine:affine@db:5432/affine
|
||||||
REDIS_SERVER_HOST: redis
|
REDIS_SERVER_HOST: redis
|
||||||
|
AFFINE_INDEXER_SEARCH_ENDPOINT: http://indexer:9308
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: pgvector/pgvector:pg16
|
image: pgvector/pgvector:pg16
|
||||||
@ -23,5 +24,19 @@ services:
|
|||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis
|
||||||
|
|
||||||
|
indexer:
|
||||||
|
image: manticoresearch/manticore:${MANTICORE_VERSION:-9.2.14}
|
||||||
|
ulimits:
|
||||||
|
nproc: 65535
|
||||||
|
nofile:
|
||||||
|
soft: 65535
|
||||||
|
hard: 65535
|
||||||
|
memlock:
|
||||||
|
soft: -1
|
||||||
|
hard: -1
|
||||||
|
volumes:
|
||||||
|
- manticoresearch_data:/var/lib/manticore
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres-data:
|
postgres-data:
|
||||||
|
manticoresearch_data:
|
||||||
|
@ -21,8 +21,3 @@ CONFIG_LOCATION=~/.affine/self-host/config
|
|||||||
DB_USERNAME=affine
|
DB_USERNAME=affine
|
||||||
DB_PASSWORD=
|
DB_PASSWORD=
|
||||||
DB_DATABASE=affine
|
DB_DATABASE=affine
|
||||||
|
|
||||||
# indexer search provider manticoresearch version
|
|
||||||
MANTICORE_VERSION=9.2.14
|
|
||||||
# position of the manticoresearch data to persist
|
|
||||||
MANTICORE_DATA_LOCATION=~/.affine/self-host/manticore
|
|
||||||
|
@ -10,8 +10,6 @@ services:
|
|||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
indexer:
|
|
||||||
condition: service_healthy
|
|
||||||
affine_migration:
|
affine_migration:
|
||||||
condition: service_completed_successfully
|
condition: service_completed_successfully
|
||||||
volumes:
|
volumes:
|
||||||
@ -23,7 +21,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- REDIS_SERVER_HOST=redis
|
- REDIS_SERVER_HOST=redis
|
||||||
- DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}
|
- DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}
|
||||||
- AFFINE_INDEXER_SEARCH_ENDPOINT=http://indexer:9308
|
- AFFINE_INDEXER_ENABLED=false
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
affine_migration:
|
affine_migration:
|
||||||
@ -39,14 +37,12 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- REDIS_SERVER_HOST=redis
|
- REDIS_SERVER_HOST=redis
|
||||||
- DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}
|
- DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}
|
||||||
- AFFINE_INDEXER_SEARCH_ENDPOINT=http://indexer:9308
|
- AFFINE_INDEXER_ENABLED=false
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
redis:
|
redis:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
indexer:
|
|
||||||
condition: service_healthy
|
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis
|
||||||
@ -78,24 +74,3 @@ services:
|
|||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
indexer:
|
|
||||||
image: manticoresearch/manticore:${MANTICORE_VERSION:-9.2.14}
|
|
||||||
container_name: affine_indexer
|
|
||||||
volumes:
|
|
||||||
- ${MANTICORE_DATA_LOCATION}:/var/lib/manticore
|
|
||||||
ulimits:
|
|
||||||
nproc: 65535
|
|
||||||
nofile:
|
|
||||||
soft: 65535
|
|
||||||
hard: 65535
|
|
||||||
memlock:
|
|
||||||
soft: -1
|
|
||||||
hard: -1
|
|
||||||
healthcheck:
|
|
||||||
test:
|
|
||||||
['CMD', 'wget', '-O-', 'http://127.0.0.1:9308']
|
|
||||||
interval: 10s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 5
|
|
||||||
restart: unless-stopped
|
|
||||||
|
@ -22,7 +22,7 @@ cp ./.docker/dev/.env.example ./.docker/dev/.env
|
|||||||
docker compose -f ./.docker/dev/compose.yml up
|
docker compose -f ./.docker/dev/compose.yml up
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Notify
|
### Notify
|
||||||
|
|
||||||
> Starting from AFFiNE 0.20, compose.yml includes a breaking change: the default database image has switched from `postgres:16` to `pgvector/pgvector:pg16`. If you were previously using another major version of Postgres, please change the number after `pgvector/pgvector:pg` to the major version you are using.
|
> Starting from AFFiNE 0.20, compose.yml includes a breaking change: the default database image has switched from `postgres:16` to `pgvector/pgvector:pg16`. If you were previously using another major version of Postgres, please change the number after `pgvector/pgvector:pg` to the major version you are using.
|
||||||
|
|
||||||
@ -108,6 +108,6 @@ yarn affine server prisma studio
|
|||||||
|
|
||||||
### Seed the db
|
### Seed the db
|
||||||
|
|
||||||
```
|
```sh
|
||||||
yarn affine server seed -h
|
yarn affine server seed -h
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user