From 846105479f51b1c8cbd6a2a4ae1aa091011c8c4a Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Mon, 14 Nov 2022 14:27:26 -0800 Subject: [PATCH] Init matrix.jafner.chat --- homelab/jafner-chat/config/matrix/.env | 1 + .../config/matrix/docker-compose.yml | 45 +++++++++++++++++++ .../jafner-chat/config/matrix/postgres.env | 1 + 3 files changed, 47 insertions(+) create mode 100644 homelab/jafner-chat/config/matrix/.env create mode 100644 homelab/jafner-chat/config/matrix/docker-compose.yml create mode 100644 homelab/jafner-chat/config/matrix/postgres.env diff --git a/homelab/jafner-chat/config/matrix/.env b/homelab/jafner-chat/config/matrix/.env new file mode 100644 index 00000000..5a53305f --- /dev/null +++ b/homelab/jafner-chat/config/matrix/.env @@ -0,0 +1 @@ +DOCKER_DATA=/home/joey/data/matrix \ No newline at end of file diff --git a/homelab/jafner-chat/config/matrix/docker-compose.yml b/homelab/jafner-chat/config/matrix/docker-compose.yml new file mode 100644 index 00000000..a7ff82ec --- /dev/null +++ b/homelab/jafner-chat/config/matrix/docker-compose.yml @@ -0,0 +1,45 @@ +version: '3' +services: + postgres: + hostname: postgres + image: postgres:14 + restart: always + volumes: + - $DOCKER_DATA/postgres/create_db.sh:/docker-entrypoint-initdb.d/20-create_db.sh + - $DOCKER_DATA/postgres/postgresql:/var/lib/postgresql/data + env_file: + - postgres.env + - postgres_secrets.env + healthcheck: + test: ["CMD-SHELL", "pg_isready -U dendrite"] + interval: 5s + timeout: 5s + retries: 5 + networks: + - matrix + + monolith: + hostname: monolith + image: matrixdotorg/dendrite-monolith:latest + command: [ + "--tls-cert=server.crt", + "--tls-key=server.key" + ] + volumes: + - $DOCKER_DATA/dendrite/config:/etc/dendrite + - $DOCKER_DATA/dendrite/media:/var/dendrite/media + depends_on: + - postgres + networks: + - matrix + - web + restart: unless-stopped + labels: + - traefik.http.routers.matrix.rule=Host(`matrix.jafner.chat`) + - traefik.http.routers.matrix.tls.certresolver=lets-encrypt + +networks: + matrix: + attachable: true + web: + external: true \ No newline at end of file diff --git a/homelab/jafner-chat/config/matrix/postgres.env b/homelab/jafner-chat/config/matrix/postgres.env new file mode 100644 index 00000000..9d2170ed --- /dev/null +++ b/homelab/jafner-chat/config/matrix/postgres.env @@ -0,0 +1 @@ +POSTGRES_USER=dendrite \ No newline at end of file