From 3458e8ba0d3543233444137589e7f79e4be44763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Galeran?= Date: Fri, 7 Apr 2023 10:52:49 +0200 Subject: feat(docker): make database name configurable (#5734) * feat(docker): make database name configurable WIP Related https://github.com/Chocobozzz/PeerTube/issues/5708 * Update .env * PEERTUBE_DB_NAME & add comments --- support/docker/production/.env | 9 +++++---- .../docker/production/config/custom-environment-variables.yaml | 6 ++++++ 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'support/docker') diff --git a/support/docker/production/.env b/support/docker/production/.env index b4e356a58..5b3b366f5 100644 --- a/support/docker/production/.env +++ b/support/docker/production/.env @@ -3,11 +3,12 @@ POSTGRES_USER= POSTGRES_PASSWORD= # Postgres database name "peertube" POSTGRES_DB=peertube -# Editable only with a suffix : -#POSTGRES_DB=peertube_prod +# The database name used by PeerTube will be PEERTUBE_DB_NAME (only if set) *OR* 'peertube'+PEERTUBE_DB_SUFFIX +#PEERTUBE_DB_NAME= #PEERTUBE_DB_SUFFIX=_prod -PEERTUBE_DB_USERNAME= -PEERTUBE_DB_PASSWORD= +# Database username and password used by PeerTube must match Postgres', so they are copied: +PEERTUBE_DB_USERNAME=$POSTGRES_USER +PEERTUBE_DB_PASSWORD=$POSTGRES_PASSWORD PEERTUBE_DB_SSL=false # Default to Postgres service name "postgres" in docker-compose.yml PEERTUBE_DB_HOSTNAME=postgres diff --git a/support/docker/production/config/custom-environment-variables.yaml b/support/docker/production/config/custom-environment-variables.yaml index 10432e6a0..8fff54229 100644 --- a/support/docker/production/config/custom-environment-variables.yaml +++ b/support/docker/production/config/custom-environment-variables.yaml @@ -1,3 +1,8 @@ +# +# This file will be read by node-config +# See https://github.com/node-config/node-config/wiki/Environment-Variables#custom-environment-variables +# + webserver: hostname: "PEERTUBE_WEBSERVER_HOSTNAME" port: @@ -19,6 +24,7 @@ database: port: __name: "PEERTUBE_DB_PORT" __format: "json" + name: "PEERTUBE_DB_NAME" suffix: "PEERTUBE_DB_SUFFIX" username: "PEERTUBE_DB_USERNAME" password: "PEERTUBE_DB_PASSWORD" -- cgit v1.2.3