11# PostgreSQL Dockerfile with primary and replica support
22
3- PostgresSQL image with Primary & ; Replica support. In order to build the image, run:
3+ PostgreSQL image with Primary & ; Replica support, plus SSL support.
4+ In order to build the image, run:
45
56``` bash
67DOCKER_REPO=ghcr.io/mutablelogic/docker-postgres make docker
78```
89
9- Replacing the ` DOCKER_REPO ` with the repository you want to use .
10+ Replacing the ` DOCKER_REPO ` with the repository you want to push the image to .
1011
1112## Environment variables
1213
@@ -22,6 +23,15 @@ docker command line:
2223* ` POSTGRES_REPLICATION_SLOT ` : ** Default is ` replica1 ` ** The replication slot for each replica.
2324 On the primary, this is a comma-separated list of replication slots. On a replica, this is the name
2425 of the replication slot used for syncronization.
26+ * ` POSTGRES_DATABASES ` : ** Optional** : A comma-separated list of databases (and associated owner role,
27+ which has the same name as the database), in addition to the main database.
28+ * ` POSTGRES_PASSWORD_<role> ` : ** Optional** : For any database which is created, you can enable
29+ login and set the password for the database owner role by setting this environment variable. Without
30+ this environment variable, the role will not be able to login.
31+ * ` POSTGRES_SSL_CERT ` : ** Optional** : The SSL certificate file location for the server, within the container.
32+ * ` POSTGRES_SSL_KEY ` : ** Optional** : The SSL private key file location for the server, within the container.
33+ * ` POSTGRES_SSL_CA ` : ** Optional** : The SSL authority certificate file location for the server, within the
34+ container.
2535
2636## Running a Primary server
2737
@@ -64,13 +74,17 @@ docker run \
6474```
6575
6676A second replica (and so forth) can be run in the same way, but with a different port and volume name.
67- You can run up to ten replicas by default.
77+ You can run up to ten replicas by default. You should ensure the primary instance is running before starting
78+ the replica.
6879
6980## Extensions
7081
71- The docker images also contain [ PostGIS] ( https://postgis.net/ ) and [ pgvector] ( https://github.com/pgvector/pgvector ) extensions.
82+ The docker images also contain [ PostGIS] ( https://postgis.net/ ) and
83+ [ pgvector] ( https://github.com/pgvector/pgvector ) extensions.
7284
7385## Bugs, feature requests and contributions
7486
75- You can raise issues and feature requests using the [ GitHub issue tracker] ( https://github.com/mutablelogic/docker-postgres/issues )
76- or send pull requests. The image is built from the [ Official Docker image] ( https://hub.docker.com/_/postgres ) .
87+ You can raise issues and feature requests using
88+ the [ GitHub issue tracker] ( https://github.com/mutablelogic/docker-postgres/issues )
89+ or send pull requests. The image is built from
90+ the [ Official Docker image] ( https://hub.docker.com/_/postgres ) .
0 commit comments