diff --git a/bitnami/postgresql/16/debian-11/Dockerfile b/bitnami/postgresql/16/debian-11/Dockerfile index 61c2d0f38b12..ff4ea57b131a 100644 --- a/bitnami/postgresql/16/debian-11/Dockerfile +++ b/bitnami/postgresql/16/debian-11/Dockerfile @@ -9,10 +9,10 @@ ARG WITH_ALL_LOCALES="no" LABEL com.vmware.cp.artifact.flavor="sha256:1e1b4657a77f0d47e9220f0c37b9bf7802581b93214fff7d1bd2364c8bf22e8e" \ org.opencontainers.image.base.name="docker.io/bitnami/minideb:bullseye" \ - org.opencontainers.image.created="2024-01-09T08:57:07Z" \ + org.opencontainers.image.created="2024-01-16T20:05:03Z" \ org.opencontainers.image.description="Application packaged by VMware, Inc" \ org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="16.1.0-debian-11-r19" \ + org.opencontainers.image.ref.name="16.1.0-debian-11-r20" \ org.opencontainers.image.title="postgresql" \ org.opencontainers.image.vendor="VMware, Inc." \ org.opencontainers.image.version="16.1.0" diff --git a/bitnami/postgresql/README.md b/bitnami/postgresql/README.md index f21faf40bbdb..c5da8c834cbf 100644 --- a/bitnami/postgresql/README.md +++ b/bitnami/postgresql/README.md @@ -13,13 +13,6 @@ Trademarks: This software listing is packaged by Bitnami. The respective tradema docker run --name postgresql bitnami/postgresql:latest ``` -### Docker Compose - -```console -curl -sSL https://raw.githubusercontent.com/bitnami/containers/main/bitnami/postgresql/docker-compose.yml > docker-compose.yml -docker-compose up -d -``` - **Warning**: This quick setup is only intended for development environments. You are encouraged to change the insecure default credentials and check out the available configuration options in the [Configuration](#configuration) section for a more secure deployment. ## Why use Bitnami Images? @@ -169,6 +162,69 @@ docker-compose up -d ## Configuration +### Environment variables + +#### Customizable environment variables + +| Name | Description | Default Value | +|----------------------------------------|--------------------------------------------------------------------------------------------------|--------------------------------------------| +| `POSTGRESQL_VOLUME_DIR` | Persistence base directory | `/bitnami/postgresql` | +| `POSTGRESQL_DATA_DIR` | PostgreSQL data directory | `${POSTGRESQL_VOLUME_DIR}/data` | +| `POSTGRESQL_INIT_MAX_TIMEOUT` | Maximum initialization waiting timeout | `60` | +| `POSTGRESQL_PGCTLTIMEOUT` | Maximum waiting timeout for pg_ctl commands | `60` | +| `POSTGRESQL_SHUTDOWN_MODE` | Default mode for pg_ctl stop command | `fast` | +| `POSTGRESQL_CLUSTER_APP_NAME` | Replication cluster default application name | `walreceiver` | +| `POSTGRESQL_DATABASE` | Default PostgreSQL database | `postgres` | +| `ALLOW_EMPTY_PASSWORD` | Allow password-less access | `no` | +| `POSTGRESQL_MASTER_PORT_NUMBER` | PostgreSQL master host port (used by slaves) | `5432` | +| `POSTGRESQL_NUM_SYNCHRONOUS_REPLICAS` | Number of PostgreSQL replicas that should use synchronous replication | `0` | +| `POSTGRESQL_PORT_NUMBER` | PostgreSQL port number | `5432` | +| `POSTGRESQL_ALLOW_REMOTE_CONNECTIONS` | Modify pg_hba settings so users can access from the outside | `yes` | +| `POSTGRESQL_REPLICATION_MODE` | PostgreSQL replication mode (values: master, slave) | `master` | +| `POSTGRESQL_SYNCHRONOUS_COMMIT_MODE` | Enable synchronous replication in slaves (number defined by POSTGRESQL_NUM_SYNCHRONOUS_REPLICAS) | `on` | +| `POSTGRESQL_FSYNC` | Enable fsync in write ahead logs | `on` | +| `POSTGRESQL_USERNAME` | PostgreSQL default username | `postgres` | +| `POSTGRESQL_ENABLE_LDAP` | Enable LDAP for PostgreSQL authentication | `no` | +| `POSTGRESQL_INITSCRIPTS_USERNAME` | Username for the psql scripts included in /docker-entrypoint.initdb | `$POSTGRESQL_USERNAME` | +| `POSTGRESQL_INITSCRIPTS_PASSWORD` | Password for the PostgreSQL init scritps user | `$POSTGRESQL_PASSWORD` | +| `POSTGRESQL_ENABLE_TLS` | Whether to enable TLS for traffic or not | `no` | +| `POSTGRESQL_TLS_PREFER_SERVER_CIPHERS` | Whether to use the server TLS cipher preferences rather than the client | `yes` | +| `POSTGRESQL_SHARED_PRELOAD_LIBRARIES` | List of libraries to preload at PostgreSQL initialization | `pgaudit` | +| `POSTGRESQL_CLIENT_MIN_MESSAGES` | Set log level of errors to send to the client | `error` | +| `POSTGRESQL_WAL_LEVEL` | Set the postgres user connection limit | `replica` | +| `POSTGRESQL_AUTOCTL_CONF_DIR` | Path to the configuration dir for the pg_autoctl command | `${POSTGRESQL_AUTOCTL_VOLUME_DIR}/.config` | +| `POSTGRESQL_AUTOCTL_MODE` | pgAutoFailover node type, valid values [monitor, postgres] | `postgres` | +| `POSTGRESQL_AUTOCTL_MONITOR_HOST` | Hostname for the monitor component | `monitor` | +| `POSTGRESQL_AUTOCTL_HOSTNAME` | Hostname by which postgres is reachable | `$(hostname --fqdn)` | + +#### Read-only environment variables + +| Name | Description | Value | +|-------------------------------------|--------------------------------------------|-----------------------------------------------| +| `POSTGRESQL_BASE_DIR` | PostgreSQL installation directory | `/opt/bitnami/postgresql` | +| `POSTGRESQL_CONF_DIR` | PostgreSQL configuration directory | `$POSTGRESQL_BASE_DIR/conf` | +| `POSTGRESQL_MOUNTED_CONF_DIR` | PostgreSQL mounted configuration directory | `$POSTGRESQL_VOLUME_DIR/conf` | +| `POSTGRESQL_CONF_FILE` | PostgreSQL configuration file | `$POSTGRESQL_CONF_DIR/postgresql.conf` | +| `POSTGRESQL_PGHBA_FILE` | PostgreSQL pg_hba file | `$POSTGRESQL_CONF_DIR/pg_hba.conf` | +| `POSTGRESQL_RECOVERY_FILE` | PostgreSQL recovery file | `$POSTGRESQL_DATA_DIR/recovery.conf` | +| `POSTGRESQL_LOG_DIR` | PostgreSQL logs directory | `$POSTGRESQL_BASE_DIR/logs` | +| `POSTGRESQL_LOG_FILE` | PostgreSQL log file | `$POSTGRESQL_LOG_DIR/postgresql.log` | +| `POSTGRESQL_TMP_DIR` | PostgreSQL temporary directory | `$POSTGRESQL_BASE_DIR/tmp` | +| `POSTGRESQL_PID_FILE` | PostgreSQL PID file | `$POSTGRESQL_TMP_DIR/postgresql.pid` | +| `POSTGRESQL_BIN_DIR` | PostgreSQL executables directory | `$POSTGRESQL_BASE_DIR/bin` | +| `POSTGRESQL_INITSCRIPTS_DIR` | Init scripts directory | `/docker-entrypoint-initdb.d` | +| `POSTGRESQL_PREINITSCRIPTS_DIR` | Pre-init scripts directory | `/docker-entrypoint-preinitdb.d` | +| `POSTGRESQL_DAEMON_USER` | PostgreSQL system user | `postgres` | +| `POSTGRESQL_DAEMON_GROUP` | PostgreSQL system group | `postgres` | +| `POSTGRESQL_AUTOCTL_VOLUME_DIR` | The pg_autoctl home directory | `${POSTGRESQL_VOLUME_DIR}/pgautoctl` | +| `POSTGRESQL_PGBACKREST_VOLUME_DIR` | The pgbackrest home directory | `${POSTGRESQL_VOLUME_DIR}/pgbackrest` | +| `POSTGRESQL_PGBACKREST_LOGS_DIR` | The pgbackrest logs directory | `${POSTGRESQL_PGBACKREST_VOLUME_DIR}/logs` | +| `POSTGRESQL_PGBACKREST_BACKUPS_DIR` | The pgbackrest backups directory | `${POSTGRESQL_PGBACKREST_VOLUME_DIR}/backups` | +| `POSTGRESQL_PGBACKREST_SPOOL_DIR` | The pgbackrest spool directory | `${POSTGRESQL_PGBACKREST_VOLUME_DIR}/spool` | +| `POSTGRESQL_PGBACKREST_CONF_FILE` | The pgbackrest spool directory | `${POSTGRESQL_DATA_DIR}/pgbackrest.conf` | +| `POSTGRESQL_FIRST_BOOT` | Flag for startup (necessary for repmgr) | `yes` | +| `NSS_WRAPPER_LIB` | Flag for startup (necessary for repmgr) | `/opt/bitnami/common/lib/libnss_wrapper.so` | + ### On container start When the container is executed, it will execute the files with extension `.sh` located at `/docker-entrypoint-preinitdb.d` before initializing or starting postgresql. @@ -852,6 +908,12 @@ docker-compose up postgresql * All volumes have been merged at `/bitnami/postgresql`. Now you only need to mount a single volume at `/bitnami/postgresql` for persistence. * The logs are always sent to the `stdout` and are no longer collected in the volume. +## Using `docker-compose.yaml` + +Please be aware this file has not undergone internal testing. Consequently, we advise its use exclusively for development or testing purposes. For production-ready deployments, we highly recommend utilizing its associated [Bitnami Helm chart](https://github.com/bitnami/charts/tree/main/bitnami/postgresql). + +If you detect any issue in the `docker-compose.yaml` file, feel free to report it or contribute with a fix by following our [Contributing Guidelines](https://github.com/bitnami/containers/blob/main/CONTRIBUTING.md). + ## Contributing We'd love for you to contribute to this container. You can request new features by creating an [issue](https://github.com/bitnami/containers/issues) or submitting a [pull request](https://github.com/bitnami/containers/pulls) with your contribution.