1
0
Fork 0
myserver-configuration/roles/matrix/templates/docker-compose.yml.j2

164 lines
5.3 KiB
Django/Jinja

version: '3'
services:
postgres:
image: postgres:latest
restart: unless-stopped
networks:
- internal
volumes:
- db:/var/lib/postgresql/data
environment:
- POSTGRES_DB=synapse
- POSTGRES_USER=synapse
- POSTGRES_PASSWORD=WRyu2kuArNjRxojstqpg7EfcoUP9zoka
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
synapse:
image: matrixdotorg/synapse:latest
restart: unless-stopped
ports:
- 8448:8448
networks:
- internal
- proxy
volumes:
- matrix:/data
- mautrix_facebook:/facebook_data
- mautrix_instagram:/instagram_data
- mautrix_discord:/discord_data
labels:
- "traefik.enable=true"
- "traefik.http.routers.matrix-secure.entrypoints=https"
- "traefik.http.routers.matrix-secure.rule=Host(`matrix.{{ server.domain }}`)"
- "traefik.http.routers.matrix-secure.tls=true"
- "traefik.http.routers.matrix-secure.tls.certresolver=sslResolver"
- "traefik.port=8008"
- "traefik.docker.network=proxy"
well-kwown:
image: nginx:latest
restart: unless-stopped
networks:
- internal
- proxy
volumes:
- ./nginx/matrix.conf:/etc/nginx/conf.d/matrix.conf
- ./nginx/www:/var/www/
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowOriginList=*"
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowHeaders=Origin, X-Requested-With, Content-Type, Accept, Authorization"
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowMethods=GET, POST, PUT, DELETE, OPTIONS"
- "traefik.http.routers.matrix-wellknown.rule=Host(`matrix.{{ server.domain }}`) && PathPrefix(`/.well-known/matrix`)"
- "traefik.http.routers.matrix-wellknown.tls=true"
- "traefik.http.routers.matrix-wellknown.tls.certresolver=sslResolver"
- "traefik.http.routers.matrix-wellknown.middlewares=cors-headers@docker"
- "traefik.docker.network=proxy"
# BRIDGE
mautrix-facebook:
container_name: mautrix-facebook
image: dock.mau.dev/mautrix/facebook:v0.4.1
restart: unless-stopped
networks:
- internal
volumes:
- mautrix_facebook:/data
mautrix-instagram:
container_name: mautrix-instagram
image: dock.mau.dev/mautrix/instagram:v0.2.3
restart: unless-stopped
networks:
- internal
volumes:
- mautrix_instagram:/data
mautrix-discord:
container_name: mautrix-discord
image: dock.mau.dev/mautrix/discord:v0.2.0
restart: unless-stopped
networks:
- internal
volumes:
- mautrix_discord:/data
# BACKUP
backup_db:
image: offen/docker-volume-backup:latest
restart: always
environment:
BACKUP_CRON_EXPRESSION: "{{ server.backup.cron_expression }}"
BACKUP_FILENAME: "{{ server.backup.filename_date_format }}-db.tar.gz"
BACKUP_LATEST_SYMLINK: db.latest.tar.gz
BACKUP_EXCLUDE_REGEXP: "\\.log$$"
BACKUP_RETENTION_DAYS: "{{ server.backup.retention_days }}"
volumes:
- db:/backup:ro
- {{ server.backup.folder }}/matrix:/archive
backup_matrix:
image: offen/docker-volume-backup:latest
restart: always
environment:
BACKUP_CRON_EXPRESSION: "{{ server.backup.cron_expression }}"
BACKUP_FILENAME: "{{ server.backup.filename_date_format }}-matrix.tar.gz"
BACKUP_LATEST_SYMLINK: matrix.latest.tar.gz
BACKUP_EXCLUDE_REGEXP: "\\.log$$"
BACKUP_RETENTION_DAYS: "{{ server.backup.retention_days }}"
volumes:
- matrix:/backup:ro
- {{ server.backup.folder }}/matrix:/archive
backup_mautrix_facebook:
image: offen/docker-volume-backup:latest
restart: always
environment:
BACKUP_CRON_EXPRESSION: "{{ server.backup.cron_expression }}"
BACKUP_FILENAME: "{{ server.backup.filename_date_format }}-mautrix-facebook.tar.gz"
BACKUP_LATEST_SYMLINK: mautrix-facebook.latest.tar.gz
BACKUP_EXCLUDE_REGEXP: "\\.log$$"
BACKUP_RETENTION_DAYS: "{{ server.backup.retention_days }}"
volumes:
- mautrix_facebook:/backup:ro
- {{ server.backup.folder }}/matrix:/archive
backup_mautrix_instagram:
image: offen/docker-volume-backup:latest
restart: always
environment:
BACKUP_CRON_EXPRESSION: "{{ server.backup.cron_expression }}"
BACKUP_FILENAME: "{{ server.backup.filename_date_format }}-mautrix-instagram.tar.gz"
BACKUP_LATEST_SYMLINK: mautrix-instagram.latest.tar.gz
BACKUP_EXCLUDE_REGEXP: "\\.log$$"
BACKUP_RETENTION_DAYS: "{{ server.backup.retention_days }}"
volumes:
- mautrix_instagram:/backup:ro
- {{ server.backup.folder }}/matrix:/archive
backup_mautrix_discord:
image: offen/docker-volume-backup:latest
restart: always
environment:
BACKUP_CRON_EXPRESSION: "{{ server.backup.cron_expression }}"
BACKUP_FILENAME: "{{ server.backup.filename_date_format }}-mautrix-discord.tar.gz"
BACKUP_LATEST_SYMLINK: mautrix-discord.latest.tar.gz
BACKUP_EXCLUDE_REGEXP: "\\.log$$"
BACKUP_RETENTION_DAYS: "{{ server.backup.retention_days }}"
volumes:
- mautrix_discord:/backup:ro
- {{ server.backup.folder }}/matrix:/archive
volumes:
db:
matrix:
mautrix_facebook:
mautrix_instagram:
mautrix_discord:
networks:
internal:
proxy:
external: true