version: "3.8"
# Conduit Matrix homeserver - Sovereign fleet communication
# Deploy: docker-compose up -d
# Requirements: Docker 20.10+, valid DNS A/AAAA and SRV records

services:
  conduit:
    image: docker.io/matrixconduit/matrix-conduit:v0.7.0
    container_name: conduit
    restart: unless-stopped
    volumes:
      - ./conduit.toml:/etc/conduit/conduit.toml:ro
      - conduit-data:/var/lib/matrix-conduit
    environment:
      CONDUIT_SERVER_NAME: ${MATRIX_SERVER_NAME:?Required}
      CONDUIT_DATABASE_BACKEND: sqlite
      CONDUIT_DATABASE_PATH: /var/lib/matrix-conduit
      CONDUIT_PORT: 6167
      CONDUIT_MAX_REQUEST_SIZE: 20_000_000
    networks:
      - matrix

  element:
    image: vectorim/element-web:v1.11.59
    container_name: element-web
    restart: unless-stopped
    volumes:
      - ./element-config.json:/app/config.json:ro
    networks:
      - matrix

  backup:
    image: rclone/rclone:latest
    container_name: conduit-backup
    volumes:
      - conduit-data:/data:ro
      - ./backup-scripts:/scripts:ro
    entrypoint: /scripts/backup.sh
    profiles: ["backup"]
    networks:
      - matrix

networks:
  matrix:
    driver: bridge

volumes:
  conduit-data:
