A custom postgres image for use with a Matrix server
Find a file
Antoine Mazeas 2610641ea6 upgrade pg 15.12
Signed-off-by: Antoine Mazeas <antoine@karthanis.net>
2025-03-16 17:48:50 +01:00
scripts First import; doc enhancement 2018-04-06 18:09:43 +07:00
Dockerfile upgrade pg 15.12 2025-03-16 17:48:50 +01:00
LICENSE Initial commit 2018-04-05 20:43:15 +07:00
README.md First import; doc enhancement 2018-04-06 18:09:43 +07:00

matrix-postgres-docker

A custom postgres image for use with a Matrix server based on postgres:10.3-alpine.

This is an optional backend for the synapse server. It is recommended for long-running or production instances.

This image has been customised to automatically create a database and db user for the synapse server, as described in matrix-org/synapse/blob/master/docs/postgres.rst.

The image exposes port 5432.

Building the image

Arguments: none! (yay!)

The created db user is synapse_user and the related database is synapse.

Note: the build script will output something like The generated user password is: <64 char long password>. This is the db user's password that goes into the synapse server's configuration file.

Example build command:

This will create an image named image_name for a server url synapse_server_url and it will be tagged latest.

docker build -t <image_name> .

Running

Exposed volumes:

Exposed ports:

Example run command:

docker run -d -v postgres-data:/var/lib/postgresql/data -p 5432:5432 <image_name>

Note that when using within docker-compose, there is no need to forward the port (omitting the -p option).