Sticking to one env-var management system (#2247)
authorLeopere <1068374+Leopere@users.noreply.github.com>
Mon, 18 Nov 2019 08:38:05 +0000 (03:38 -0500)
committerChocobozzz <me@florianbigard.com>
Mon, 18 Nov 2019 08:38:05 +0000 (09:38 +0100)
* Sticking to one env-var management system

Starting with the Postgres container so that you only have to set overlapping environment variables in one place.

* Moving Postfix envvars pt 1

* Moving Postfix envvars pt 2 .env file

* Added missing envvars.

* Adding functioning glue

Suggest something better if you wish.

* removed IP from example

* Removed default network from update.

support/docker/production/.env
support/docker/production/docker-compose.yml

index c8393d0ce808c61d5fb2338644c32101f6aabadf..95ca42d6971ad5438ee02ceb3e4bb0ead3893743 100644 (file)
@@ -1,5 +1,9 @@
-PEERTUBE_DB_USERNAME=postgres_user
-PEERTUBE_DB_PASSWORD=postgres_password
+POSTGRES_USER=peertube
+POSTGRES_PASSWORD=peertube
+POSTGRES_DB=peertube
+PEERTUBE_DB_USERNAME=$(POSTGRES_USER)
+PEERTUBE_DB_PASSWORD=$(POSTGRES_PASSWORD)
+PEERTUBE_DB_HOSTNAME=postgres
 PEERTUBE_WEBSERVER_HOSTNAME=domain.tld
 PEERTUBE_WEBSERVER_PORT=443
 PEERTUBE_WEBSERVER_HTTPS=true
@@ -14,6 +18,7 @@ PEERTUBE_SMTP_FROM=noreply@domain.tld
 PEERTUBE_SMTP_TLS=false
 PEERTUBE_SMTP_DISABLE_STARTTLS=false
 PEERTUBE_ADMIN_EMAIL=admin@domain.tld
+POSTFIX_myhostname=${PEERTUBE_WEBSERVER_HOSTNAME}
 # /!\ Prefer to use the PeerTube admin interface to set the following configurations /!\
 #PEERTUBE_SIGNUP_ENABLED=true
 #PEERTUBE_TRANSCODING_ENABLED=true
index 3786ae675c55129e6d4b7770bb31db93f8f6c262..9f6c47eca388178d53868b94b8c994287b6c6c7c 100644 (file)
@@ -47,10 +47,8 @@ services:
 
   postgres:
     image: postgres:10-alpine
-    environment:
-      POSTGRES_USER: ${PEERTUBE_DB_USERNAME}
-      POSTGRES_PASSWORD: ${PEERTUBE_DB_PASSWORD}
-      POSTGRES_DB: peertube
+    env_file:
+      - .env
     volumes:
       - ./docker-volume/db:/var/lib/postgresql/data
     restart: "always"
@@ -67,8 +65,8 @@ services:
 
   postfix:
     image: mwader/postfix-relay
-    environment:
-      - POSTFIX_myhostname=${PEERTUBE_WEBSERVER_HOSTNAME}
+    env_file:
+      - .env
     labels:
       traefik.enable: "false"
     restart: "always"