From dd5878b25693e180720be884f910c1a09e772095 Mon Sep 17 00:00:00 2001 From: Christian Winther Date: Wed, 6 Mar 2024 20:49:36 +0000 Subject: [PATCH] Allow setting the DB root password seperately Fixes https://github.com/pixelfed/pixelfed/issues/4980 --- .env.docker | 8 ++++++++ docker-compose.yml | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.env.docker b/.env.docker index 0d5836745..e524155fd 100644 --- a/.env.docker +++ b/.env.docker @@ -1202,6 +1202,14 @@ DOCKER_DB_HOST_PORT="${DB_PORT:?error}" # @dottie/validate required,number DOCKER_DB_CONTAINER_PORT="${DB_PORT:?error}" +# root password for the database. By default uses DB_PASSWORD +# but can be changed in situations where you are migrating +# to the included docker-compose and have a different password +# set already +# +# @dottie/validate required +DOCKER_DB_ROOT_PASSWORD="${DB_PASSWORD:?error}" + # How often Docker health check should run for [db] service # @dottie/validate required DOCKER_DB_HEALTHCHECK_INTERVAL="${DOCKER_ALL_DEFAULT_HEALTHCHECK_INTERVAL:?error}" diff --git a/docker-compose.yml b/docker-compose.yml index 5df433c83..767a509b2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -166,12 +166,12 @@ services: environment: TZ: "${TZ:?error}" # MySQL (Oracle) - "Environment Variables" at https://hub.docker.com/_/mysql - MYSQL_ROOT_PASSWORD: "${DB_PASSWORD:?error}" + MYSQL_ROOT_PASSWORD: "${DOCKER_DB_ROOT_PASSWORD:?error}" MYSQL_USER: "${DB_USERNAME:?error}" MYSQL_PASSWORD: "${DB_PASSWORD:?error}" MYSQL_DATABASE: "${DB_DATABASE:?error}" # MySQL (MariaDB) - "Start a mariadb server instance with user, password and database" at https://hub.docker.com/_/mariadb - MARIADB_ROOT_PASSWORD: "${DB_PASSWORD:?error}" + MARIADB_ROOT_PASSWORD: "${DOCKER_DB_ROOT_PASSWORD:?error}" MARIADB_USER: "${DB_USERNAME:?error}" MARIADB_PASSWORD: "${DB_PASSWORD:?error}" MARIADB_DATABASE: "${DB_DATABASE:?error}"