Thanks to visit codestin.com
Credit goes to github.com

Skip to content

SyneHQ/pg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

38 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ SyneHQ PostgreSQL with pgvector Docker Image ๐Ÿš€

synehq Logo

Enterprise-grade Vector Database Solutions by SyneHQ

This Dockerfile creates a production-ready PostgreSQL database with pgvector extension enabled for vector similarity search capabilities. It also includes pg_stat_statements extension for query performance monitoring, developed and maintained by SyneHQ.

๐Ÿ“ข Looking for a standard PostgreSQL image? Check out our synehq/pg image for non-vector database requirements! Same enterprise-grade quality without the vector extensions. Perfect for traditional database workloads! ๐Ÿ˜

Visit SyneHQ Docker Pulls GitHub License

โœจ Features โœจ

  • ๐Ÿข Enterprise-ready vector database solution
  • ๐Ÿ˜ Based on official pgvector/pgvector:pg17 image
  • ๐Ÿ“Š Includes pg_stat_statements extension for query performance monitoring
  • ๐Ÿ” Configured with vector similarity search support
  • ๐Ÿ”Œ Increased max connections (200)
  • ๐Ÿง™โ€โ™‚๏ธ Automatic initialization with vector extensions and sample table
  • ๐Ÿ”ฎ Pre-configured similarity search function
  • ๐Ÿš„ Production-grade performance optimizations

Getting Started

docker run -d --name postgres-pgvector \
    -e POSTGRES_PASSWORD=your_password \
    -p 5432:5432 \
    -v $(pwd)/certificates:/etc/postgresql/ssl \
    ghcr.io/synehq/pg-vector
docker run -d --name postgres-pg \
    -e POSTGRES_PASSWORD=your_password \
    -p 5432:5432 \
    -v $(pwd)/certificates:/etc/postgresql/ssl \
    ghcr.io/synehq/pg

๐ŸŽฏ Quick Start for development ๐ŸŽฏ

๐Ÿ”จ Building the Image

docker build -t synehq/pg-vector vector/
docker build -t synehq/pg .

๐Ÿ”’ Generating Self-Signed Certificates (for Testing)

Need some certificates but don't want the hassle? We've got you covered! ๐Ÿ›ก๏ธ

Check this article here

This approach provides secure ways to pass SSL certificates to your PostgreSQL container, ensuring proper encryption for your database connections while maintaining security best practices.

๐Ÿšข Running the Container

docker run -d --name postgres-pgvector \
    -e POSTGRES_PASSWORD=your_password \
    -p 5432:5432 \
    -v $(pwd)/certificates:/etc/postgresql/ssl \
    ghcr.io/synehq/pg-vector
docker run -d --name postgres-pg \
    -e POSTGRES_PASSWORD=your_password \
    -v $(pwd)/certificates:/etc/postgresql/ssl \
    -p 5432:5432 \
    ghcr.io/synehq/pg

๐Ÿ’ป Accessing the Database

docker exec -it postgres-pgvector psql -U postgres

๐Ÿฆธ Features & Capabilities ๐Ÿฆธโ€โ™€๏ธ

๐Ÿ”ง Initial Setup

The container automatically:

  • ๐Ÿ”Œ Enables the vector and pg_stat_statements extensions
  • ๐Ÿ“‹ Creates a sample 'items' table with vector embedding support
  • ๐Ÿš€ Sets up an IVFFlat index for efficient similarity search
  • ๐Ÿงช Creates a helper function for vector similarity matching

๐Ÿงฉ Sample Usage

-- Insert a sample item (it's that easy! ๐ŸŽ‰)
INSERT INTO items (description, embedding) 
VALUES ('Sample item', '[0.1, 0.2, ..., 0.5]'::vector);

-- Find similar items (like magic! ๐Ÿช„)
SELECT * FROM match_items(
    '[0.1, 0.2, ..., 0.5]'::vector,  -- query embedding
    0.8,                             -- similarity threshold
    5                                -- number of results
);

๐Ÿ“š Technical Documentation ๐Ÿ“š

๐Ÿ“Š Available Tables

items

  • id: Serial primary key
  • description: Text description (tell us your stories! ๐Ÿ“)
  • embedding: Vector(1536) for storing embeddings (where the magic happens! โœจ)
  • created_at: Timestamp of creation (we like to keep track of time! โฐ)

๐Ÿ› ๏ธ Available Functions

match_items(query_embedding, match_threshold, match_count)

Finds similar items based on vector similarity (like finding your database soulmates! ๐Ÿ’˜):

  • query_embedding: Vector to match against
  • match_threshold: Minimum similarity score (0-1)
  • match_count: Maximum number of results to return

๐Ÿง  SyneHQ Database Options ๐Ÿง 

Image Use Case Features
synehq/postgres-pgvector AI & Vector Search PostgreSQL + pgvector for similarity search, embeddings storage, and AI applications
synehq/pg Standard Database Enterprise-grade PostgreSQL without vector extensions, optimized for traditional workloads

Choose the right tool for your job! Both images include our enterprise-grade optimizations and support. ๐Ÿ› ๏ธ

๐Ÿ†˜ Support & Resources ๐Ÿ†˜

๐Ÿข About synehq ๐Ÿข

synehq provides enterprise-grade database solutions for modern AI applications. Our technology powers thousands of production deployments worldwide, helping businesses leverage the power of vector similarity search at scale. We're like database superheros, but without the capes! ๐Ÿฆธโ€โ™‚๏ธ๐Ÿฆธโ€โ™€๏ธ

๐Ÿ“œ License ๐Ÿ“œ

This project is licensed under the MIT License - see synehq.com/license for details. No fine print, we promise! ๐Ÿ˜‰


Built with โค๏ธ by synehq

Website โ€ข Documentation โ€ข Blog โ€ข Contact

Made with ๐Ÿ•, ๐Ÿฆ, and a little bit of database magic! โœจ

About

Production grade postgres docker containers

Topics

Resources

Stars

Watchers

Forks

Packages