| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This Docker image extends the official PostgreSQL image with PostGIS and pgvector extensions, specifically designed for TypeORM development and testing environments. It provides a configurable PostgreSQL instance with spatial and vector search capabilities.
Pre-built images are available on GitHub Container Registry (GHCR). Replace yourusername/yourrepositoryname with your actual GHCR path (e.g., ghcr.io/naorpeled/typeorm-postgres-docker).
Example tags (refer to the publish.yml workflow matrix for all combinations):
The following build arguments can be used with docker build --build-arg VAR=value or via the args section in docker-compose.yml (which can use environment variables from your .env file):
# Build with default versions
docker build -t your-image-name .
# Build with custom versions (using Docker build args)
docker build \\
--build-arg PG_MAJOR_VERSION=15 \\
--build-arg POSTGIS_MAJOR_VERSION=3 \\
--build-arg PGVECTOR_TAG=v0.7.2 \\
-t your-image-name:custom .To ensure pgvector is properly preloaded for optimal performance, pass the shared_preload_libraries setting to the postgres command. This is handled by the command directive in the provided docker-compose.yml.
docker run -d \\
--name postgres-gis-vector \\
-e POSTGRES_PASSWORD=yourpassword \\
-e POSTGRES_USER=youruser \\
-e POSTGRES_DB=yourdb \\
-p 5432:5432 \\
-v postgres_data_volume:/var/lib/postgresql/data \\
your-image-name postgres -c shared_preload_libraries=vectorThe provided docker-compose.yml is configured to build and run the image, including preloading pgvector via the command directive.
# docker-compose.yml (snippet)
services:
db:
build:
context: .
args:
PG_MAJOR_VERSION: ${PG_MAJOR:-16}
POSTGIS_MAJOR_VERSION: ${POSTGIS_MAJOR_VERSION:-3}
PGVECTOR_TAG: ${PGVECTOR_VERSION:-v0.8.0}
command: postgres -c shared_preload_libraries=vector # Ensures pgvector preloading
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-test} # TypeORM test default
POSTGRES_USER: ${POSTGRES_USER:-test} # TypeORM test default
POSTGRES_DB: ${POSTGRES_DB:-test} # TypeORM test default
# ... other environment variables ...Create a .env file in the same directory as docker-compose.yml to set build arguments and PostgreSQL credentials (optional, defaults are provided):
# .env (example)
PG_MAJOR=16
POSTGIS_MAJOR_VERSION=3
PGVECTOR_VERSION=v0.8.0
POSTGRES_PASSWORD=supersecret
POSTGRES_USER=myuser
POSTGRES_DB=mydb
POSTGRES_PORT=5432
# ADDITIONAL_DATABASES=db1,db2Then run:
docker compose up --build -dThis repository includes GitHub Actions workflows:
This image is configured to be a drop-in replacement for PostgreSQL in TypeORM projects.
This setup ensures that TypeORM can connect and utilize PostGIS and pgvector functionalities seamlessly.
Inherits all environment variables from the official PostgreSQL image. See the official PostgreSQL image documentation for details.
The build arguments PG_MAJOR_VERSION, POSTGIS_MAJOR_VERSION, and PGVECTOR_TAG are also exposed as environment variables with the same names within the running container for runtime inspection.
Additional runtime environment variables for the entrypoint script:
The repository includes docker-compose.test.yml for more comprehensive local testing that mirrors some aspects of the CI tests.
To run tests locally using this file:
# Build and test with default versions using environment variables from your .env or defaults
docker compose -f docker-compose.test.yml up --build --exit-code-from test
# Test with specific versions by setting environment variables for the compose command:
PG_MAJOR=15 POSTGIS_MAJOR_VERSION=3 PGVECTOR_VERSION=v0.7.2 docker compose -f docker-compose.test.yml up --build --exit-code-from testMIT
| Back | FazBrowse Home | New Git URL |