Browse Source

Sticking to one env-var management system (#2247)

* 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.
Leopere 8 months ago
parent
commit
e2882b2ccb
2 changed files with 11 additions and 8 deletions
  1. 7
    2
      support/docker/production/.env
  2. 4
    6
      support/docker/production/docker-compose.yml

+ 7
- 2
support/docker/production/.env View File

@@ -1,5 +1,9 @@
1
-PEERTUBE_DB_USERNAME=postgres_user
2
-PEERTUBE_DB_PASSWORD=postgres_password
1
+POSTGRES_USER=peertube
2
+POSTGRES_PASSWORD=peertube
3
+POSTGRES_DB=peertube
4
+PEERTUBE_DB_USERNAME=$(POSTGRES_USER)
5
+PEERTUBE_DB_PASSWORD=$(POSTGRES_PASSWORD)
6
+PEERTUBE_DB_HOSTNAME=postgres
3 7
 PEERTUBE_WEBSERVER_HOSTNAME=domain.tld
4 8
 PEERTUBE_WEBSERVER_PORT=443
5 9
 PEERTUBE_WEBSERVER_HTTPS=true
@@ -14,6 +18,7 @@ PEERTUBE_SMTP_FROM=noreply@domain.tld
14 18
 PEERTUBE_SMTP_TLS=false
15 19
 PEERTUBE_SMTP_DISABLE_STARTTLS=false
16 20
 PEERTUBE_ADMIN_EMAIL=admin@domain.tld
21
+POSTFIX_myhostname=${PEERTUBE_WEBSERVER_HOSTNAME}
17 22
 # /!\ Prefer to use the PeerTube admin interface to set the following configurations /!\
18 23
 #PEERTUBE_SIGNUP_ENABLED=true
19 24
 #PEERTUBE_TRANSCODING_ENABLED=true

+ 4
- 6
support/docker/production/docker-compose.yml View File

@@ -47,10 +47,8 @@ services:
47 47
 
48 48
   postgres:
49 49
     image: postgres:10-alpine
50
-    environment:
51
-      POSTGRES_USER: ${PEERTUBE_DB_USERNAME}
52
-      POSTGRES_PASSWORD: ${PEERTUBE_DB_PASSWORD}
53
-      POSTGRES_DB: peertube
50
+    env_file:
51
+      - .env
54 52
     volumes:
55 53
       - ./docker-volume/db:/var/lib/postgresql/data
56 54
     restart: "always"
@@ -67,8 +65,8 @@ services:
67 65
 
68 66
   postfix:
69 67
     image: mwader/postfix-relay
70
-    environment:
71
-      - POSTFIX_myhostname=${PEERTUBE_WEBSERVER_HOSTNAME}
68
+    env_file:
69
+      - .env
72 70
     labels:
73 71
       traefik.enable: "false"
74 72
     restart: "always"

Loading…
Cancel
Save