🤖 This README was written by GPT-4. 🤖
This project focuses on creating a Docker image that combines the functionalities of PostGIS and pgvector, offering an easy-to-use solution for working with spatial data and vector similarity in PostgreSQL. It is designed to be as simple as integrating any other PostgreSQL Docker image into your workflow.
PostGIS: An extension to PostgreSQL that allows it to store spatial data and perform spatial operations.pgvector: An extension for PostgreSQL designed for efficient similarity search in high dimensional vector spaces.
The Dockerfile starts with the postgis/postgis:16-3.4 image and installs essential packages including build tools, PostgreSQL server development tools, and git. It then clones and installs pgvector. The Dockerfile is optimized to reduce the layer size by cleaning up after installations.
docker-compose.yml sets up two services:
postgis_pgvector: Builds the Docker image from the provided Dockerfile and sets up a volume for data persistence. It also configures the environment for PostgreSQL.pgadmin: Uses thedpage/pgadmin4:7.8image for database management through a web interface. It also sets up a volume for pgAdmin data.
- Build and Run: Use
docker compose upto build the image and run the containers. - Accessing pgAdmin: Navigate to http://localhost:80 in your web browser. Default credentials are set in the
docker-compose.ymlfile but can be overridden with environment variables. - Connecting to the Database: Connect to your PostGIS-pgvector database using standard PostgreSQL connection methods. Default database details are provided in the
docker-compose.yml.
- Environment Variables: Set
POSTGRES_PASSWORD,POSTGRES_DB,PGADMIN_DEFAULT_EMAIL, andPGADMIN_DEFAULT_PASSWORDin your environment or directly in thedocker-compose.yml. - Ports and Volumes: Modify ports and volume bindings in
docker-compose.ymlas per your requirements.
- Ensure Docker and Docker Compose are installed on your system.
- The image can be customized further by modifying the Dockerfile and
docker-compose.ymlas needed. - This image is currently intended for development and testing purposes.
- For production use, consider securing your database and pgAdmin with stronger passwords and appropriate network settings.
Your contributions are welcome! To contribute, please follow the standard fork and pull request workflow.
This project is licensed under the MIT License.