From f4e4d1144f93460fc66e0ff7ef79af9a6da6a50d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=2E=20D=C3=ADaz?= Date: Fri, 15 Sep 2023 18:40:07 +0200 Subject: [PATCH] upd: hostnames --- common.yaml.jinja | 7 ++----- prod.yaml.jinja | 3 +++ test.yaml.jinja | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/common.yaml.jinja b/common.yaml.jinja index a276ebf9..4b48cb9a 100644 --- a/common.yaml.jinja +++ b/common.yaml.jinja @@ -21,9 +21,6 @@ services: PGUSER: &dbuser "{{ postgres_username }}" PROXY_MODE: "{% if odoo_proxy %}true{% else %}false{% endif %}" LIST_DB: "{{ odoo_listdb | tojson }}" - {%- if smtp_canonical_default %} - hostname: "{{ smtp_canonical_default }}" - {%- endif %} tty: true volumes: - filestore:/var/lib/odoo:z @@ -54,7 +51,7 @@ services: smtpreal: image: ghcr.io/docker-mailserver/docker-mailserver:{{ smtp_relay_version }} - hostname: "smtp.{{ smtp_canonical_default }}" + hostname: "{{ smtp_canonical_default }}" stop_grace_period: 1m volumes: - mailconfig:/tmp/docker-mailserver:z @@ -87,7 +84,7 @@ services: backup: image: ghcr.io/tecnativa/docker-duplicity-postgres{% if backup_dst.startswith(('boto3+s3://', 's3://', 's3+http://')) %}-s3{% endif %}:{{ backup_image_version }} - hostname: backup{% if macros.first_main_domain(domains_prod) %}.{{ macros.first_main_domain(domains_prod) }}{% endif %} + hostname: backup.{% if domains_prod %}{{ macros.first_main_domain(domains_prod) }}{% else %}{{ project_name|replace('.','-') }}{% endif %} init: true environment: DB_VERSION: "{{ postgres_version or 'latest' }}" diff --git a/prod.yaml.jinja b/prod.yaml.jinja index ec6f223c..a5fc664c 100644 --- a/prod.yaml.jinja +++ b/prod.yaml.jinja @@ -10,6 +10,9 @@ services: file: common.yaml service: odoo restart: unless-stopped + {%- if domains_prod %} + hostname: "{{ macros.first_main_domain(domains_prod)|tojson }}" + {%- endif %} env_file: - .docker/odoo.env - .docker/db-access.env diff --git a/test.yaml.jinja b/test.yaml.jinja index 0b1e20b9..4d03fce0 100644 --- a/test.yaml.jinja +++ b/test.yaml.jinja @@ -19,6 +19,9 @@ services: SMTP_PORT: "1025" SMTP_SERVER: smtplocal restart: unless-stopped + {%- if domains_test %} + hostname: "{{ macros.first_main_domain(domains_test)|tojson }}" + {%- endif %} depends_on: - db - smtp