Browse Source

Merge branch 'matrix' into 'master'

Matrix

See merge request altermediatic/docker-atelier!6
Guilhem Saurel 6 years ago
parent
commit
c39393ca46
3 changed files with 83 additions and 0 deletions
  1. 11 0
      matrix/Dockerfile
  2. 24 0
      matrix/README.md
  3. 48 0
      matrix/docker-compose.yml

+ 11 - 0
matrix/Dockerfile

@@ -0,0 +1,11 @@
+FROM nginx:alpine
+
+WORKDIR /usr/share/nginx/html
+RUN apk add --no-cache curl
+
+ARG RIOT_VERSION
+ARG SYNAPSE_SERVER_NAME
+
+RUN curl -sSL https://github.com/vector-im/riot-web/releases/download/$RIOT_VERSION/riot-$RIOT_VERSION.tar.gz | tar -xz
+RUN mv riot-$RIOT_VERSION/* .
+RUN sed "/default_hs_url/s/https:\/\/matrix.org/\/\/$SYNAPSE_SERVER_NAME/" config.sample.json > config.json

+ 24 - 0
matrix/README.md

@@ -0,0 +1,24 @@
+# Matrix & Riot
+
+https://matrix.org & https://riot.im
+
+## DNS
+
+For this project, you need to setup both `matrix` & `riot` subdomains of `$CHATONS_DOMAIN` (which defaults to `local`)
+
+## Configure
+
+```
+echo POSTGRES_PASSWORD=$(openssl rand -base64 32) >> .env
+echo SYNAPSE_REPORT_STATS=no >> .env
+echo SYNAPSE_ENABLE_REGISTRATION=yes >> .env
+echo SYNAPSE_SMTP_PORT=465 >> .env
+echo SYNAPSE_SMTP_HOST=mail.gandi.net >> .env
+echo SYNAPSE_SMTP_USER=dev@oxyta.net >> .env
+echo SYNAPSE_SMTP_PASSWORD=changeme >> .env
+```
+
+## Deploy
+```
+docker-compose up -d
+```

+ 48 - 0
matrix/docker-compose.yml

@@ -0,0 +1,48 @@
+version: "3"
+
+networks:
+  proxytanet:
+    external: true
+
+services:
+  app:
+    image: matrixdotorg/synapse:v0.32.1
+    restart: unless-stopped
+    env_file:
+      - .env
+    environment:
+      - SYNAPSE_SERVER_NAME=matrix.${CHATONS_DOMAIN:-local}
+    labels:
+      traefik.enable: "true"
+      traefik.frontend.rule: "Host: matrix.${CHATONS_DOMAIN:-local}, www.matrix.${CHATONS_DOMAIN:-local}"
+      traefik.docker.network: "proxytanet"
+    networks:
+      - proxytanet
+      - default
+    volumes:
+      - ${CHATONS_ROOT_DIR:-/srv/chatons}/matrix/data:/data
+    ports:
+      - 8448:8448
+
+  db:
+    image: postgres:10-alpine
+    restart: always
+    env_file:
+      - .env
+    environment:
+      - POSTGRES_USER=synapse
+      - POSTGRES_DB=synapse
+    volumes:
+      - ${CHATONS_ROOT_DIR:-/srv/chatons}/matrix/postgres:/var/lib/postgresql/data
+
+  riot:
+    build:
+      context: .
+      args:
+        SYNAPSE_SERVER_NAME: matrix.${CHATONS_DOMAIN:-local}
+        RIOT_VERSION: v0.15.6
+    labels:
+      traefik.enable: "true"
+      traefik.frontend.rule: "Host: riot.${CHATONS_DOMAIN:-local}, www.riot.${CHATONS_DOMAIN:-local}"
+    networks:
+      - proxytanet