Sign inSign up

ruxwez/postgres

By ruxwez

•Updated 5 months ago

🐘 PostgreSQL Docker image with popular extensions (PostGIS, pgvector).

Image
Databases & storage
0

2.5K

ruxwez/postgres repository overview

⁠PostgreSQL Extensions Installer (derived Docker image)

Docker Pulls GitHub branch check runs GitHub contributors GitHub License GitHub Issues or Pull Requests

Repository: https://github.com/ruxwez/postgres⁠

⁠Purpose

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.

⁠Included extensions

  • PostGIS — PostGIS 3 (PostgreSQL 16 / 17 / 18) — see src/extensions/postgis.rs
  • pgvector — v0.8.1 (PostgreSQL 16 / 17 / 18) — see src/extensions/pgvector.rs
  • pgmq — v1.7.0 (PostgreSQL 16 / 17 / 18) — see src/extensions/pgmq.rs

Also installed:

  • postgresql-contrib

During 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.

⁠Usage

⁠Docker Run
docker run -d \
  --name postgres \
  -e POSTGRES_PASSWORD=mysecretpassword \
  -p 5432:5432 \
  ruxwez/postgres:17
⁠Docker Compose
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:

Tag summary

Content type

Image

Digest

sha256:89af4497b…

Size

256 MB

Last updated

5 months ago

docker pull ruxwez/postgres