services: db: build: context: . args: PG_VERSION: ${PG_VERSION:-18.6} # Environment variable PG_VERSION, defaults to 18.6 POSTGIS_VERSION: ${POSTGIS_VERSION:-3.6.4} # Environment variable POSTGIS_VERSION, defaults to 3.6.4 PGVECTOR_VERSION: ${PGVECTOR_VERSION:-0.8.6} # Environment variable PGVECTOR_VERSION, defaults to 0.8.6 environment: # TypeORM test defaults, or override with your own .env file POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-test} POSTGRES_USER: ${POSTGRES_USER:-test} POSTGRES_DB: ${POSTGRES_DB:-test} PGDATA: /var/lib/postgresql/pgdata ADDITIONAL_DATABASES: ${ADDITIONAL_DATABASES:-} ports: - "${POSTGRES_PORT:-5432}:5432" volumes: - postgres_data:/var/lib/postgresql healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-test}"] interval: 10s timeout: 5s retries: 5 # Add the command to preload pgvector for optimal performance # This ensures shared_preload_libraries includes 'vector' command: postgres -c shared_preload_libraries=vector volumes: postgres_data: