diff --git a/.devcontainer/build.sh b/.devcontainer/build.sh index 9642696b66..4a19252cbb 100644 --- a/.devcontainer/build.sh +++ b/.devcontainer/build.sh @@ -6,6 +6,7 @@ yarn install # Build Server Dependencies yarn affine @affine/server-native build +yarn affine @affine/reader build # Create database yarn affine @affine/server prisma migrate reset -f diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 0a3bc9cd42..4a35798f50 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -10,6 +10,7 @@ services: environment: DATABASE_URL: postgresql://affine:affine@db:5432/affine REDIS_SERVER_HOST: redis + AFFINE_INDEXER_SEARCH_ENDPOINT: http://indexer:9308 db: image: pgvector/pgvector:pg16 @@ -23,5 +24,19 @@ services: 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: postgres-data: + manticoresearch_data: diff --git a/.docker/selfhost/.env.example b/.docker/selfhost/.env.example index b0520a1849..7ec7e2c82c 100644 --- a/.docker/selfhost/.env.example +++ b/.docker/selfhost/.env.example @@ -21,8 +21,3 @@ CONFIG_LOCATION=~/.affine/self-host/config DB_USERNAME=affine DB_PASSWORD= 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 diff --git a/.docker/selfhost/compose.yml b/.docker/selfhost/compose.yml index 53b09824b7..7d3139e3e5 100644 --- a/.docker/selfhost/compose.yml +++ b/.docker/selfhost/compose.yml @@ -10,8 +10,6 @@ services: condition: service_healthy postgres: condition: service_healthy - indexer: - condition: service_healthy affine_migration: condition: service_completed_successfully volumes: @@ -23,7 +21,7 @@ services: environment: - REDIS_SERVER_HOST=redis - 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 affine_migration: @@ -39,14 +37,12 @@ services: environment: - REDIS_SERVER_HOST=redis - 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: postgres: condition: service_healthy redis: condition: service_healthy - indexer: - condition: service_healthy redis: image: redis @@ -78,24 +74,3 @@ services: timeout: 5s retries: 5 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 diff --git a/docs/developing-server.md b/docs/developing-server.md index 4fe6c98515..3aa89e8fa6 100644 --- a/docs/developing-server.md +++ b/docs/developing-server.md @@ -22,7 +22,7 @@ cp ./.docker/dev/.env.example ./.docker/dev/.env 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. @@ -108,6 +108,6 @@ yarn affine server prisma studio ### Seed the db -``` +```sh yarn affine server seed -h ```