public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
[Nginx] Use SOGo IPv4 for upstream
8853e2c4
data/Dockerfiles/nginx/bootstrap.py | 5 +++--
data/Dockerfiles/nginx/docker-entrypoint.sh | 8 ++++----
docker-compose.yml | 8 ++++----
3 files changed, 11 insertions(+), 10 deletions(-)
Diff
diff --git a/data/Dockerfiles/nginx/bootstrap.py b/data/Dockerfiles/nginx/bootstrap.py
index 0d24ae9b..d47e6318 100644
--- a/data/Dockerfiles/nginx/bootstrap.py
+++ b/data/Dockerfiles/nginx/bootstrap.py
@@ -20,8 +20,9 @@ def nginx_conf(env, template_vars):
f.write(config)
def prepare_template_vars():
+ ipv4_network = os.getenv("IPV4_NETWORK", "172.22.1")
template_vars = {
- 'IPV4_NETWORK': os.getenv("IPV4_NETWORK", "172.22.1"),
+ 'IPV4_NETWORK': ipv4_network,
'TRUSTED_NETWORK': os.getenv("TRUSTED_NETWORK", False),
'SKIP_RSPAMD': os.getenv("SKIP_RSPAMD", "n").lower() in ("y", "yes"),
'SKIP_SOGO': os.getenv("SKIP_SOGO", "n").lower() in ("y", "yes"),
@@ -30,7 +31,7 @@ def prepare_template_vars():
'ADDITIONAL_SERVER_NAMES': os.getenv("ADDITIONAL_SERVER_NAMES", "").replace(',', ' '),
'HTTP_PORT': os.getenv("HTTP_PORT", "80"),
'HTTPS_PORT': os.getenv("HTTPS_PORT", "443"),
- 'SOGOHOST': os.getenv("SOGOHOST", "sogo-mailcow"),
+ 'SOGOHOST': os.getenv("SOGOHOST", ipv4_network + ".248"),
'RSPAMDHOST': os.getenv("RSPAMDHOST", "rspamd-mailcow"),
'PHPFPMHOST': os.getenv("PHPFPMHOST", "php-fpm-mailcow"),
}
diff --git a/data/Dockerfiles/nginx/docker-entrypoint.sh b/data/Dockerfiles/nginx/docker-entrypoint.sh
index beb0b4d9..ea2e048e 100755
--- a/data/Dockerfiles/nginx/docker-entrypoint.sh
+++ b/data/Dockerfiles/nginx/docker-entrypoint.sh
@@ -1,9 +1,9 @@
#!/bin/sh
-until ping ${REDISHOST} -c1 > /dev/null; do
- echo "Waiting for Redis..."
- sleep 1
-done
+PHPFPMHOST=${PHPFPMHOST:-"php-fpm-mailcow"}
+SOGOHOST=${SOGOHOST:-"$IPV4_NETWORK.248"}
+RSPAMDHOST=${RSPAMDHOST:-"rspamd-mailcow"}
+
until ping ${PHPFPMHOST} -c1 > /dev/null; do
echo "Waiting for PHP..."
sleep 1
diff --git a/docker-compose.yml b/docker-compose.yml
index 226c48ac..f815ab9b 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -382,10 +382,10 @@ services:
- TZ=${TZ}
- SKIP_SOGO=${SKIP_SOGO:-n}
- SKIP_RSPAMD=${SKIP_RSPAMD:-n}
- - PHPFPMHOST=${PHPFPMHOST:-php-fpm-mailcow}
- - SOGOHOST=${SOGOHOST:-sogo-mailcow}
- - RSPAMDHOST=${RSPAMDHOST:-rspamd-mailcow}
- - REDISHOST=${REDISHOST:-redis-mailcow}
+ - PHPFPMHOST=${PHPFPMHOST:-}
+ - SOGOHOST=${SOGOHOST:-}
+ - RSPAMDHOST=${RSPAMDHOST:-}
+ - REDISHOST=${REDISHOST:-}
- IPV4_NETWORK=${IPV4_NETWORK:-172.22.1}
volumes:
- ./data/web:/web:ro,z