diff --git a/README.md b/README.md index f47c24a..ffc7d6e 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ Most variables are the same as in the [official postgres image](https://hub.dock | BACKUP_KEEP_MONTHS | Number of monthly backups to keep before removal. Defaults to `6`. | | BACKUP_KEEP_MINS | Number of minutes for `last` folder backups to keep before removal. Defaults to `1440`. | | BACKUP_LATEST_TYPE | Type of `latest` pointer (`symlink`,`hardlink`,`none`). Defaults to `symlink`. | +| VALIDATE_ON_START | If set to `FALSE` does not validate the configuration on start. Disabling this is not recommended. Defaults to `TRUE`. | | HEALTHCHECK_PORT | Port listening for cron-schedule health check. Defaults to `8080`. | | POSTGRES_DB | Comma or space separated list of postgres databases to backup. If POSTGRES_CLUSTER is set this refers to the database to connect to for dumping global objects and discovering what other databases should be dumped (typically is either `postgres` or `template1`). Required. | | POSTGRES_DB_FILE | Alternative to POSTGRES_DB, but with one database per line, for usage with docker secrets. | diff --git a/alpine.Dockerfile b/alpine.Dockerfile index ff2ecc7..9b3d163 100644 --- a/alpine.Dockerfile +++ b/alpine.Dockerfile @@ -21,6 +21,7 @@ ENV POSTGRES_DB="**None**" \ POSTGRES_EXTRA_OPTS="-Z1" \ POSTGRES_CLUSTER="FALSE" \ SCHEDULE="@daily" \ + VALIDATE_ON_START="TRUE" \ BACKUP_ON_START="FALSE" \ BACKUP_DIR="/backups" \ BACKUP_SUFFIX=".sql.gz" \ diff --git a/debian.Dockerfile b/debian.Dockerfile index 9bb78e4..2971913 100644 --- a/debian.Dockerfile +++ b/debian.Dockerfile @@ -35,6 +35,7 @@ ENV POSTGRES_DB="**None**" \ POSTGRES_EXTRA_OPTS="-Z1" \ POSTGRES_CLUSTER="FALSE" \ SCHEDULE="@daily" \ + VALIDATE_ON_START="TRUE" \ BACKUP_ON_START="FALSE" \ BACKUP_DIR="/backups" \ BACKUP_SUFFIX=".sql.gz" \ diff --git a/init.sh b/init.sh index 0c5428d..71efd13 100755 --- a/init.sh +++ b/init.sh @@ -2,7 +2,9 @@ set -Eeo pipefail # Prevalidate configuration (don't source) -/env.sh +if [ "${VALIDATE_ON_START}" = "TRUE" ]; then + /env.sh +fi EXTRA_ARGS="" # Initial background backup