A PostgreSQL server Docker image for Colibri, a self-hosted, personal ebook management platform. This image augments the official PostgreSQL image with additional extensions and configuration.
While it is primarily intended for use with Colibri, it can also be used as a general-purpose PostgreSQL server. The image includes the following extensions:
supabase_vault: To manage secrets and sensitive data.pg_cron: For scheduling periodic tasks within the database.pgvector: For vector similarity search.isn: For International Standard Number (ISN) support.
The image allows setting the libsodium root encryption key via three different ways:
- Docker Secret: Mount a secret file containing the key at 
/run/secrets/pgsodium_key - Secret file environment variable: Set the environment variable 
PGSODIUM_KEY_FILEto the path of the secret file - Environment variable: Set the environment variable 
PGSODIUM_KEYto the key value directly 
The key must be a 32-byte base64-encoded string. You can generate a key using the following command:
openssl rand -base64 32You can also mount additional configuration files into the container by mounting them to the /etc/postgresql/
directory, which is configured as an include directory in the main postgresql.conf file. This allows you to
add custom configurations or extensions without modifying the main configuration file.
Refer to the official PostgreSQL documentation for the upstream image for more advanced customization options.
To use this image, you can run it with Docker Compose or directly with Docker:
ghcr.io/colibri-hq/postgres:latest
Below is an example of a Docker Compose file that sets up the PostgreSQL server with a custom configuration file and a Docker Secret for the libsodium key:
services:
  postgres:
    image: ghcr.io/colibri-hq/postgres:latest
    environment:
      POSTGRES_USER: colibri
      POSTGRES_PASSWORD: colibri
      PGSODIUM_KEY_FILE: /run/secrets/pgsodium_key
    secrets:
      - pgsodium_key
    volumes:
      - ./custom-config.conf:/etc/postgresql/