From 4f88f200b13f10b18f4679ecfd19ef9b0245ba32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Thu, 4 Mar 2021 23:32:09 +0100 Subject: [PATCH] Getting closer... --- roles/docker/tasks/services/mailman.yml | 86 +++++++++++++++---------- 1 file changed, 51 insertions(+), 35 deletions(-) diff --git a/roles/docker/tasks/services/mailman.yml b/roles/docker/tasks/services/mailman.yml index 7899cc7..fde72a6 100644 --- a/roles/docker/tasks/services/mailman.yml +++ b/roles/docker/tasks/services/mailman.yml @@ -4,38 +4,14 @@ docker_compose: project_name: "mailman" definition: - version: '2' + version: '3' services: - mailman-web: - image: maxking/mailman-web:0.3.5 - depends_on: - - database - links: - - database:database - volumes: - - /opt/mailman/web:/opt/mailman-web-data - environment: - DATABASE_TYPE: "postgres" - DATABASE_URL: "postgres://mailman:{{ mailman_secrets.postgres_password }}@database/mailmandb" - HYPERKITTY_API_KEY: "{{ mailman_secrets.hyperkitty_api_key }}" - SERVE_FROM_DOMAIN: "lists.data.coop" - MAILMAN_ADMIN_USER: "valberg" - MAILMAN_ADMIN_EMAIL: "valberg@orn.li" - SECRET_KEY: "{{ mailman_secrets.django_secret_key }}" - VIRTUAL_HOST: "lists.data.coop" - VIRTUAL_PORT: 8000 - LETSENCRYPT_HOST: "lists.data.coop" - LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}" - networks: - - "mailman" - - "postfix" - - "external_services" mailman-core: - image: maxking/mailman-core:0.3 + image: maxking/mailman-core:0.3.11 volumes: - - /opt/mailman/core:/opt/mailman/ + - "{{ volume_root_folder }}/mailman/core:/opt/mailman" stop_grace_period: 30s links: - mailman-web:mailmain-web @@ -43,29 +19,69 @@ depends_on: - database environment: - DATABASE_URL: "postgres://mailman:{{ mailman_secrets.postgres_password }}@database/mailmandb" + DATABASE_URL: "postgres://mailman:{{ mailman_secrets.postgres_password }}@172.19.199.4/mailmandb" DATABASE_TYPE: "postgres" DATABASE_CLASS: "mailman.database.postgresql.PostgreSQLDatabase" HYPERKITTY_API_KEY: "{{ mailman_secrets.hyperkitty_api_key }}" + HYPERKITTY_URL: http://172.19.199.3:8000/hyperkitty + MTA: "postfix" + SMTP_HOST: "{{ smtp_host }}" + SMTP_PORT: "{{ smtp_port }}" + MM_HOSTNAME: "172.19.199.2" networks: - - "mailman" - - "postfix" - - "external_services" + mailman: + ipv4_address: 172.19.199.2 + postfix: + external_services: + + mailman-web: + image: maxking/mailman-web:0.3.11 + depends_on: + - database + links: + - database:database + volumes: + - "{{ volume_root_folder }}/mailman/web:/opt/mailman-web-data" + environment: + DATABASE_TYPE: "postgres" + DATABASE_URL: "postgres://mailman:{{ mailman_secrets.postgres_password }}@172.19.199.4/mailmandb" + HYPERKITTY_API_KEY: "{{ mailman_secrets.hyperkitty_api_key }}" + DJANGO_ALLOWED_HOSTS: "lists.data.coop" + SERVE_FROM_DOMAIN: "lists.data.coop" + MAILMAN_ADMIN_USER: "valberg" + MAILMAN_ADMIN_EMAIL: "valberg@orn.li" + MAILMAN_REST_URL: "http://172.19.199.2:8001" + SECRET_KEY: "{{ mailman_secrets.django_secret_key }}" + VIRTUAL_HOST: "lists.data.coop" + VIRTUAL_PORT: 8080 + LETSENCRYPT_HOST: "lists.data.coop" + LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}" + networks: + mailman: + ipv4_address: 172.19.199.3 + postfix: + external_services: database: + image: postgres:13 + restart: always environment: POSTGRES_DB: mailmandb POSTGRES_USER: mailman POSTGRES_PASSWORD: "{{ mailman_secrets.postgres_password }}" - restart: always - image: postgres:13 volumes: - - /opt/mailman/database:/var/lib/postgresql/data + - "{{ volume_root_folder }}/mailman/database:/var/lib/postgresql/data" networks: - - "mailman" + mailman: + ipv4_address: 172.19.199.4 networks: mailman: + driver: bridge + ipam: + driver: default + config: + - subnet: 172.19.199.0/24 postfix: external: true external_services: