Bump PostgreSQL image to version 17; add the auto-migrate preparation service (#1281)

* Bump PostgreSQL image to version 17; add the auto-migrate preparation service

* Address bot's comments

* Fix many warnings in the Readme; added better explanations

* Address bot's comments

* And a few more comments addressed

* 1 more small wording fix

* Better clarify the HW acceleration options

* add link to the pgsql upgrade guide

---------

Co-authored-by: Konstantin Koval
This commit is contained in:
Kostiantyn
2025-08-21 23:20:44 +03:00
committed by GitHub
parent 03b290eba7
commit 1b3ebc3ce7
2 changed files with 117 additions and 44 deletions

View File

@@ -134,9 +134,9 @@ services:
security_opt: ## see https://github.com/MariaDB/mariadb-docker/issues/434#issuecomment-1136151239
- seccomp:unconfined
- apparmor:unconfined
## Uncomment next 2 lines if you want to access the database directly
## Uncomment the following 2 lines if you want to access the database directly
# ports:
# - "3306:3306"
# - "3306:3306" ## host:container
environment:
MARIADB_AUTO_UPGRADE: "1"
MARIADB_DATABASE: ${MARIADB_DATABASE}
@@ -156,9 +156,34 @@ services:
retries: 5
start_period: 3m
## Uncomment the `postgres-autoupgrade` service if you want to upgrade PostgreSQL automatically, or follow the
## official PostgreSQL upgrade guide https://www.postgresql.org/docs/current/upgrading.html manually.
## Don't forget to uncomment the 3 `depends_on` lines in the `postgres` service.
## This service will upgrade the PostgreSQL database to the version 17.
## Read more on the https://hub.docker.com/r/pgautoupgrade/pgautoupgrade
## Tip: Back up the Photoview data before autoupgrade to a new PostgreSQL version.
## It is an optional service to simplify the upgrade process. You can also upgrade PostgreSQL manually.
## It is safe to keep it enabled, as if it detects no upgrade is needed, it exits immediately.
# postgres-autoupgrade:
# image: pgautoupgrade/pgautoupgrade:17-alpine
# hostname: pgsql-upg
# container_name: pgsql-upg
# restart: "no"
# environment:
# POSTGRES_DB: ${PGSQL_DATABASE}
# POSTGRES_USER: ${PGSQL_USER}
# POSTGRES_PASSWORD: ${PGSQL_PASSWORD}
# PGAUTO_ONESHOT: "yes"
# volumes:
# ## Example:
# ## - "/host/folder:/container/folder"
# - "/etc/localtime:/etc/localtime:ro" ## use local time from host
# - "/etc/timezone:/etc/timezone:ro" ## use timezone from host
# - "${HOST_PHOTOVIEW_LOCATION}/database/postgres:/var/lib/postgresql/data" ## DO NOT REMOVE
## Uncomment the `postgres` service if PHOTOVIEW_DATABASE_DRIVER is set to `postgres` in the .env
# postgres:
# image: postgres:16-alpine
# image: postgres:17-alpine
# labels:
# - "com.centurylinklabs.watchtower.enable=true"
# hostname: photoview-pgsql
@@ -169,9 +194,13 @@ services:
# security_opt:
# - seccomp:unconfined
# - apparmor:unconfined
# ## Uncomment next 2 lines if you want to access the database directly
# ## Uncomment the following 3 lines if you want to use the autoupgrade service
# #depends_on:
# # postgres-autoupgrade:
# # condition: service_completed_successfully
# ## Uncomment the following 2 lines if you want to access the database directly
# # ports:
# # - 5432:5432
# # - "5432:5432" ## host:container
# environment:
# POSTGRES_DB: ${PGSQL_DATABASE}
# POSTGRES_USER: ${PGSQL_USER}