- /roles/matrix/files/homeserver.yaml - /roles/matrix/templates/homeserver.yaml.j2 - /roles/matrix/templates/docker-compose.yml.j2 - /roles/matrix/tasks/main.yml
46 lines
1.3 KiB
Django/Jinja
46 lines
1.3 KiB
Django/Jinja
version: '3.8'
|
|
services:
|
|
matrix-postgres:
|
|
image: postgres:13
|
|
container_name: matrix-postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: "{{ matrix_postgres_user }}"
|
|
POSTGRES_PASSWORD: "{{ matrix_postgres_password }}"
|
|
POSTGRES_DB: "{{ matrix_postgres_db }}"
|
|
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --lc-collate=C --lc-ctype=C"
|
|
volumes:
|
|
- "{{ matrix_postgres_dir }}:/var/lib/postgresql/data"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U {{ matrix_postgres_user }}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- matrix-network
|
|
|
|
matrix-synapse:
|
|
image: matrixdotorg/synapse:latest
|
|
container_name: matrix-synapse
|
|
restart: unless-stopped
|
|
ports:
|
|
- "{{ matrix_port }}:8008"
|
|
volumes:
|
|
- "{{ matrix_config_dir }}:/data"
|
|
- "{{ matrix_media_dir }}:/data/media"
|
|
environment:
|
|
- SYNAPSE_CONFIG_PATH=/data/homeserver.yaml
|
|
depends_on:
|
|
matrix-postgres:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8008/health"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 3
|
|
networks:
|
|
- matrix-network
|
|
|
|
networks:
|
|
matrix-network:
|
|
driver: bridge |