From 82a376818e053f38df87825604e67ed9d9c037ff Mon Sep 17 00:00:00 2001 From: DoTheEvolution Date: Wed, 20 May 2020 20:29:12 +0200 Subject: [PATCH] update --- README.md | 32 +++++++++++++++++--------------- bitwarden_rs/readme.md | 4 ++-- bookstack/readme.md | 4 ++-- caddy_v2/readme.md | 14 +++++++------- homer/readme.md | 4 ++-- nextcloud/readme.md | 4 ++-- portainer/readme.md | 4 ++-- prometheus_grafana/readme.md | 4 ++-- watchtower/readme.md | 1 - 9 files changed, 36 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 2ae35bb..77c5f15 100644 --- a/README.md +++ b/README.md @@ -28,35 +28,37 @@ It's described in most details. ### Compose and environment variables -When making changes use `docker-compose down`, not just restart or stop. +When making changes use `docker-compose down` and `docker-compose up -d`, +not just restart or stop/start. -You **do not** need to fuck with `docker-compose.yml` to get something up, +* You **do not** need to fuck with `docker-compose.yml` to get something up, simple copy paste should suffice. -You **do** need to fuck with `.env` file, that's where all the variables are. +* You **do** need to fuck with `.env` file, that's where all the variables are. -Sometimes the `.env` file is used as `env_file` +Often the `.env` file is used as `env_file` -* `.env` - actual name of a file, used only by compose.
+`env_file: .env` + +* `.env` - actual name of a file that is used only by compose.
It is used automatically just by being in the directory with the `docker-compose.yml`
Variables set there are available during the building of the container, - but unless named in the `enviroment:` option they are not available + but unless named in the `environment:` option they are not available in the running containers. * `env_file` - an option in compose that defines an existing external file.
Variables in this file will be available in the running container, but not during building of the container. -So to not have polluted huge ass compose file, or to not have multiple places -where changes need to be made when adding a variable... `env_file: .env` BAM. +Benefit is that you do not need to make changes at multiple places, +adding variable or changing its name in `.env` does not require +to also go in to compose to add/change it there..
+Also the compose file looks less cramped. -Only issue is that all variables from `.env` are available in -containers that use this.
-That can lead to potential conflicts and clashes, looking at you nextcloud. - -In those cases variables names are declared per container. - -But `env_file: .env` is just easier, prettier... and mostly painless. +Only issue is that **all** variables from `.env` are available in +containers that use this method.
+That can lead to potential issues if you try to use this approach elsewhere, +universally. --- diff --git a/bitwarden_rs/readme.md b/bitwarden_rs/readme.md index ae9c9cc..d84a48f 100644 --- a/bitwarden_rs/readme.md +++ b/bitwarden_rs/readme.md @@ -72,14 +72,14 @@ services: networks: default: external: - name: $DEFAULT_NETWORK + name: $DOCKER_MY_NETWORK ``` `.env` ```bash # GENERAL MY_DOMAIN=example.com -DEFAULT_NETWORK=caddy_net +DOCKER_MY_NETWORK=caddy_net TZ=Europe/Bratislava # BITWARDEN diff --git a/bookstack/readme.md b/bookstack/readme.md index 0e64dd7..d9fbfd2 100644 --- a/bookstack/readme.md +++ b/bookstack/readme.md @@ -76,14 +76,14 @@ services: networks: default: external: - name: $DEFAULT_NETWORK + name: $DOCKER_MY_NETWORK ``` `.env` ```bash # GENERAL MY_DOMAIN=example.com -DEFAULT_NETWORK=caddy_net +DOCKER_MY_NETWORK=caddy_net TZ=Europe/Bratislava #LINUXSERVER.IO diff --git a/caddy_v2/readme.md b/caddy_v2/readme.md index f40da68..2244161 100644 --- a/caddy_v2/readme.md +++ b/caddy_v2/readme.md @@ -101,7 +101,7 @@ You want to change `example.com` to your domain. `.env` ```bash MY_DOMAIN=example.com -DEFAULT_NETWORK=caddy_net +DOCKER_MY_NETWORK=caddy_net ``` Domain names, api keys, email settings, ip addresses, database credentials, ... @@ -147,7 +147,7 @@ services: networks: default: external: - name: $DEFAULT_NETWORK + name: $DOCKER_MY_NETWORK ``` * port 80 and 443 are mapped for http and https @@ -214,7 +214,7 @@ services: networks: default: external: - name: $DEFAULT_NETWORK + name: $DOCKER_MY_NETWORK ``` `nginx-compose.yml` @@ -230,7 +230,7 @@ services: networks: default: external: - name: $DEFAULT_NETWORK + name: $DOCKER_MY_NETWORK ``` ### - editing hosts file @@ -355,7 +355,7 @@ services: networks: default: external: - name: $DEFAULT_NETWORK + name: $DOCKER_MY_NETWORK ``` With this setup, and assuming docker host at: `192.168.1.222`, @@ -538,7 +538,7 @@ Add `CLOUDFLARE_API_TOKEN` variable with the value of the newly created token. `.env` ``` MY_DOMAIN=example.com -DEFAULT_NETWORK=caddy_net +DOCKER_MY_NETWORK=caddy_net CLOUDFLARE_API_TOKEN=asdasdasdasdasasdasdasdasdas ``` @@ -572,7 +572,7 @@ services: networks: default: external: - name: $DEFAULT_NETWORK + name: $DOCKER_MY_NETWORK ``` diff --git a/homer/readme.md b/homer/readme.md index 84d795f..c3130de 100644 --- a/homer/readme.md +++ b/homer/readme.md @@ -55,14 +55,14 @@ services: networks: default: external: - name: $DEFAULT_NETWORK + name: $DOCKER_MY_NETWORK ``` `.env` ```bash # GENERAL MY_DOMAIN=example.com -DEFAULT_NETWORK=caddy_net +DOCKER_MY_NETWORK=caddy_net TZ=Europe/Bratislava ``` diff --git a/nextcloud/readme.md b/nextcloud/readme.md index 503db4b..376f926 100644 --- a/nextcloud/readme.md +++ b/nextcloud/readme.md @@ -123,14 +123,14 @@ services: networks: default: external: - name: $DEFAULT_NETWORK + name: $DOCKER_MY_NETWORK ``` `.env` ```bash # GENERAL MY_DOMAIN=example.com -DEFAULT_NETWORK=caddy_net +DOCKER_MY_NETWORK=caddy_net TZ=Europe/Bratislava # NEXTCLOUD-MARIADB diff --git a/portainer/readme.md b/portainer/readme.md index 7eae905..ae82458 100644 --- a/portainer/readme.md +++ b/portainer/readme.md @@ -58,14 +58,14 @@ services: networks: default: external: - name: $DEFAULT_NETWORK + name: $DOCKER_MY_NETWORK ``` `.env` ```bash # GENERAL MY_DOMAIN=example.com -DEFAULT_NETWORK=caddy_net +DOCKER_MY_NETWORK=caddy_net TZ=Europe/Bratislava ``` diff --git a/prometheus_grafana/readme.md b/prometheus_grafana/readme.md index 80654e8..ec48a74 100644 --- a/prometheus_grafana/readme.md +++ b/prometheus_grafana/readme.md @@ -184,7 +184,7 @@ services: networks: default: external: - name: $DEFAULT_NETWORK + name: $DOCKER_MY_NETWORK ``` `.env` @@ -192,7 +192,7 @@ networks: ```bash # GENERAL MY_DOMAIN=example.com -DEFAULT_NETWORK=caddy_net +DOCKER_MY_NETWORK=caddy_net TZ=Europe/Bratislava # GRAFANA diff --git a/watchtower/readme.md b/watchtower/readme.md index ca3d2e0..cddb2e6 100644 --- a/watchtower/readme.md +++ b/watchtower/readme.md @@ -59,7 +59,6 @@ services: `.env` ```bash # GENERAL -DEFAULT_NETWORK=caddy_net # WATCHTOWER WATCHTOWER_SCHEDULE=0 0 0 * * SAT