Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

feat(docker): make database name configurable (#5734)

Joël Galeran3458e8ba0d35
diff --git a/support/docker/production/.env b/support/docker/production/.env
index b4e356a58f..5b3b366f57 100644
--- a/support/docker/production/.env
+++ b/support/docker/production/.env
@@ -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
diff --git a/support/docker/production/config/custom-environment-variables.yaml b/support/docker/production/config/custom-environment-variables.yaml
index 10432e6a04..8fff542295 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"