I wanted a way to add the ankane/pgvector PostgreSQL extension to the DDEV postgres service. I created a .ddev/db-build/Dockerfile file and added the code from https://github.com/pgvector/pgvector/blob/v0.5.1/Dockerfile (except the FROM), but had errors during building the container (make does not work). Maybe someone has an example or a hint?
Question posted in PostgreSQL
The official documentation can be found here.
The official documentation can be found here.
2
Answers
The main problem was, that I had to install the
build-essential
package. Addeddbimage_extra_packages: [build-essential]
in the config.yaml.And on the image you can see my Docker configuration to have pgvector in place:
Content of the Dockerfile.vector:
For more information about the customization of Docker images look here: https://ddev.readthedocs.io/en/latest/users/extend/customizing-images/#adding-extra-dockerfiles-for-webimage-and-dbimage
An other way is to create an additional docker compose yaml in the .ddev directory. This way we can use the ankane/pgvector image:
Example of the docker-compose.pgvector.yaml file: