🐘 PostgreSQL Docker image with popular extensions (PostGIS, pgvector).
2.5K
Repository: https://github.com/ruxwez/postgres
This project builds a Docker image derived from the official postgres image that already includes several popular PostgreSQL extensions installed and ready to use. Extensions are installed during the image build using a Rust binary (install-extensions) that is compiled in a builder stage and executed inside the base PostgreSQL image.
The main goal is to save time and reduce complexity when deploying PostgreSQL containers that require common extensions preinstalled and compiled for the selected PostgreSQL version.
src/extensions/postgis.rssrc/extensions/pgvector.rssrc/extensions/pgmq.rsAlso installed:
postgresql-contribDuring the build, temporary packages required to compile the extensions are installed (for example build-essential, git, postgresql-server-dev-<major>, ca-certificates). These packages are removed at the end of the build process to reduce the final image size.
docker run -d \
--name postgres \
-e POSTGRES_PASSWORD=mysecretpassword \
-p 5432:5432 \
ruxwez/postgres:17
version: '3.8'
services:
postgres:
image: ruxwez/postgres:17
container_name: postgres
environment:
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_USER: postgres
POSTGRES_DB: mydatabase
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data:
Content type
Image
Digest
sha256:89af4497b…
Size
256 MB
Last updated
5 months ago
docker pull ruxwez/postgres