diff --git a/matrix/.env.example b/matrix/.env.example new file mode 100644 index 0000000..fcb65f3 --- /dev/null +++ b/matrix/.env.example @@ -0,0 +1,2 @@ +DATA_PATH= +SYNAPSE_CN= diff --git a/matrix/docker-compose.yml b/matrix/docker-compose.yml new file mode 100644 index 0000000..32c6a3c --- /dev/null +++ b/matrix/docker-compose.yml @@ -0,0 +1,55 @@ +version: "3.8" + +services: + app: + image: matrixdotorg/synapse:v1.70.1 + depends_on: + - db + expose: + - "8008" + restart: unless-stopped + networks: + - proxy + - default + environment: + - SYNAPSE_CONFIG_PATH=/data/homeserver.yaml + - UID=1000 + - GID=1000 + volumes: + - ${DATA_PATH}/synapse:/data + env_file: secrets/app.secrets + healthcheck: + test: ["CMD", "curl", "-fSs", "http://localhost:8008/health"] + interval: 15s + timeout: 5s + retries: 3 + start_period: 5s + labels: + - "traefik.enable=true" + - "traefik.docker.network=proxy" + - "traefik.http.services.synapse-web-svc.loadbalancer.server.port=8008" + - "traefik.http.routers.synapse-https.service=synapse-web-svc" + - "traefik.http.middlewares.synapse-redirect-websecure.redirectscheme.scheme=https" + - "traefik.http.routers.synapse-http.middlewares=synapse-redirect-websecure" + - "traefik.http.routers.synapse-http.rule=Host(`${SYNAPSE_CN}`)" + - "traefik.http.routers.synapse-http.entrypoints=web" + - "traefik.http.routers.synapse-https.rule=Host(`${SYNAPSE_CN}`)" + - "traefik.http.routers.synapse-https.entrypoints=websecure" + - "traefik.http.routers.synapse-https.tls=true" + - "traefik.http.routers.synapse-https.tls.certresolver=myhttpchallenge" + + db: + image: postgres:13.4-alpine + env_file: ./secrets/db.secrets + environment: + - LC_COLLATE=C + - LC_CTYPE=C + - LANG=fr_FR.UTF-8 + restart: unless-stopped + volumes: + - ${DATA_PATH}/db/data:/var/lib/postgresql/data + - ${DATA_PATH}/db/.pgpass:/root/.pgpass + +networks: + proxy: + external: true diff --git a/matrix/secrets/app.secrets.example b/matrix/secrets/app.secrets.example new file mode 100644 index 0000000..e69de29 diff --git a/matrix/secrets/db.secrets.example b/matrix/secrets/db.secrets.example new file mode 100644 index 0000000..aee9b58 --- /dev/null +++ b/matrix/secrets/db.secrets.example @@ -0,0 +1,3 @@ +POSTGRES_USER= +POSTGRES_DB= +POSTGRES_PASSWORD=