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
pull/5762/head
Joël Galeran 2023-04-07 10:52:49 +02:00 committed by GitHub
parent b302c80dc0
commit 3458e8ba0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -3,11 +3,12 @@ POSTGRES_USER=<MY POSTGRES USERNAME>
POSTGRES_PASSWORD=<MY 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=<MY POSTGRES DB NAME>
#PEERTUBE_DB_SUFFIX=_prod
PEERTUBE_DB_USERNAME=<MY POSTGRES USERNAME>
PEERTUBE_DB_PASSWORD=<MY POSTGRES 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

View File

@ -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"