Posgres de_DE localed with pgvector baked in
1.9K
SRC: https://github.com/vroomfondel/arley/blob/main/postgrespgvector/Dockerfile_postgres
This Docker image provides a production-ready PostgreSQL database server with the pgvector extension pre-compiled and installed, enabling high-performance vector similarity search for machine learning, embeddings, and retrieval-augmented generation (RAG) workflows.
Built on the official PostgreSQL Docker image, this container extends the base functionality by compiling and installing the latest pgvector extension from source. It is designed for developers and teams working with vector embeddings, semantic search, and AI/ML applications requiring efficient similarity queries (cosine distance, L2 distance, inner product) on high-dimensional vectors.
The image includes a pre-configured German UTF-8 locale (de_DE.UTF-8, LANG=de_DE.utf8) to support internationalized applications, and is optimized for use in local development, continuous integration pipelines, and small to medium production deployments.
18-trixie-pgvector-0.8.1) based on PostgreSQL version, Debian base, and pgvector release, as well as a :latest convenience tag.CREATE EXTENSION command.docker run --rm -d \
--name postgres-pgvector \
-e POSTGRES_PASSWORD=your_password \
-e POSTGRES_USER=your_user \
-e POSTGRES_DB=your_database \
-p 5432:5432 \
xomoxcc/postgreslocaled:latest
After the container starts, connect to your database and enable the extension:
psql postgresql://your_user:[email protected]:5432/your_database \
-c "CREATE EXTENSION IF NOT EXISTS vector;"
-- Enable pgvector extension
CREATE EXTENSION IF NOT EXISTS vector;
-- Create a table with 768-dimensional embeddings
CREATE TABLE documents (
id bigserial PRIMARY KEY,
content text NOT NULL,
embedding vector(768)
);
-- Create an approximate nearest neighbor index (IVFFLAT)
CREATE INDEX documents_embedding_idx
ON documents USING ivfflat (embedding vector_cosine_ops)
WITH (lists = 100);
-- Optimize ANN recall
SET ivfflat.probes = 10;
-- Query: Find 5 most similar documents
SELECT id, content
FROM documents
ORDER BY embedding <=> '[0.1, 0.2, ..., 0.768]'::vector
LIMIT 5;
Images follow the naming convention:
xomoxcc/postgreslocaled:<postgres_version>-<debian_version>-pgvector-<pgvector_version>
18-trixie-pgvector-0.8.1xomoxcc/postgreslocaled:latest (tracks the most recent build)Default Versions (as of latest build):
This image inherits all configuration options from the official PostgreSQL Docker image. Key environment variables:
POSTGRES_PASSWORD (required): Superuser passwordPOSTGRES_USER (optional, default: postgres): Superuser usernamePOSTGRES_DB (optional, default: value of POSTGRES_USER): Default database namePOSTGRES_INITDB_ARGS (optional): Additional arguments for initdbPGDATA (optional, default: /var/lib/postgresql/data): Data directorySee the official Postgres image documentation for advanced configuration (init scripts, custom configs, etc.).
For optimal vector search performance:
ivfflat (faster build, moderate recall) or hnsw (slower build, better recall).lists (IVFFLAT) or m/ef_construction (HNSW) based on dataset size.SET ivfflat.probes = N; to control query-time accuracy/speed tradeoff.<=> (cosine distance) for normalized embeddings<-> (L2 distance) for Euclidean similarity<#> (inner product) for dot-product similarityRefer to the pgvector documentation for detailed tuning guidance.
Multi-arch images are built using Docker Buildx and pushed as manifest lists for automatic platform detection.
This image was originally developed as an optional vector database backend for the Arley RAG assistant project, providing an alternative to ChromaDB for vector storage in legal/document-oriented AI workflows. It can be used standalone or integrated with any application requiring PostgreSQL with vector capabilities.
The Dockerfile and build scripts are available in the source repository. To build locally:
git clone https://github.com/vroomfondel/arley.git
cd arley/postgrespgvector
./build_postgres_localed.sh onlylocal
For multi-architecture builds, see the build_postgres_localed.sh script and ensure Docker Buildx and QEMU/binfmt are configured.
This image is provided under the same licensing terms as the parent Arley project (primarily LGPL where applicable). The underlying PostgreSQL software is licensed under the PostgreSQL License, and pgvector is licensed under the PostgreSQL License. See repository license files for details.
This is a development/experimental project. For production use, review security settings, customize configurations, and test thoroughly in your environment. Provided "as is" without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software. Use at your own risk.
Content type
Image
Digest
sha256:abf91369f…
Size
519.9 MB
Last updated
4 months ago
docker pull xomoxcc/postgreslocaled