diff --git a/docs/11-upgrading/02-archive/05-upgrade-to-pgvector.md b/docs/11-upgrading/02-archive/05-upgrade-to-pgvector.md index b01037ed..9c066148 100644 --- a/docs/11-upgrading/02-archive/05-upgrade-to-pgvector.md +++ b/docs/11-upgrading/02-archive/05-upgrade-to-pgvector.md @@ -1,6 +1,6 @@ # Upgrade to pgvector -New Serverpod projects automatically include pgvector support through the `pgvector/pgvector` PostgreSQL Docker image. However, existing projects need to be upgraded to use vector functionality. +New Serverpod projects automatically included pgvector support through the `pgvector/pgvector` PostgreSQL Docker image. From 4.0.0-beta.2, the compose file uses `ghcr.io/serverpod/postgres:16` instead, which is that image plus PostGIS. Existing projects need to be upgraded to use vector functionality. :::info This upgrade is only necessary if you want to use vector fields in your models. If you do not plan to use vector fields, you can skip this upgrade. diff --git a/docs/11-upgrading/04-upgrade-to-postgis.md b/docs/11-upgrading/04-upgrade-to-postgis.md index f830d111..a47817fd 100644 --- a/docs/11-upgrading/04-upgrade-to-postgis.md +++ b/docs/11-upgrading/04-upgrade-to-postgis.md @@ -16,12 +16,12 @@ If trying to use geography fields without upgrading, you will encounter an error ## For Docker-based environments -1. Update your `docker-compose.yml` to use a PostgreSQL image with PostGIS (e.g., `postgis/postgis:16-3.5`): +1. Update your `docker-compose.yml` to use `ghcr.io/serverpod/postgres:16`, the Serverpod PostgreSQL image. It ships with [PostGIS and pgvector](../concepts/data-and-the-database/database/vector-and-geography-fields) already installed: ```yaml services: postgres: - image: postgis/postgis:16-3.5 # <-- Change from postgres image here + image: ghcr.io/serverpod/postgres:16 # <-- Change from postgres image here ports: - '8090:5432' environment: @@ -34,7 +34,7 @@ services: # Other services... postgres_test: - image: postgis/postgis:16-3.5 # <-- Change from postgres image here + image: ghcr.io/serverpod/postgres:16 # <-- Change from postgres image here ports: - '9090:5432' environment: @@ -45,32 +45,7 @@ services: - _test_data:/var/lib/postgresql/data ``` -If your project also uses [vector fields](../concepts/data-and-the-database/database/vector-and-geography-fields), you need both pgvector and PostGIS. Create a custom `Dockerfile` instead: - -```dockerfile -FROM pgvector/pgvector:pg16 -RUN apt-get update \ - && apt-get install -y --no-install-recommends postgresql-16-postgis-3 \ - && rm -rf /var/lib/apt/lists/* -``` - -Then reference it in your `docker-compose.yml`: - -```yaml -services: - postgres: - build: - context: . - dockerfile: Dockerfile - ports: - - '8090:5432' - environment: - POSTGRES_USER: postgres - POSTGRES_DB: - POSTGRES_PASSWORD: - volumes: - - _data:/var/lib/postgresql/data -``` +If your `docker-compose.yaml` came from Serverpod 4.0.0-beta.2 or later, it already references this image and needs no change. 2. Recreate your containers to use the new image: