datacoop.ansible/roles/docker/tasks/services/matrix_riot.yml

81 lines
1.9 KiB
YAML

---
- name: matrix network
docker_network:
name: matrix
- name: matrix database volume
docker_volume:
name: matrix_db
- name: riot volume
docker_volume:
name: riot_app
- name: upload riot config.json
template:
src: files/configs/riot-config.json
dest: /var/lib/docker/volumes/riot_app/_data/config.json
- name: upload riot.im.conf
template:
src: files/configs/riot.im.conf
dest: /var/lib/docker/volumes/riot_app/_data/riot.im.conf
- name: matrix database container
docker_container:
name: matrix_db
image: postgres:10
state: started
restart_policy: always
networks:
- name: matrix
volumes:
- matrix_db:/var/lib/postgresql/data
env:
POSTGRES_USER: "synapse"
POSTGRES_PASSWORD: "{{ postgres_passwords.matrix }}"
- name: matrix container
docker_container:
name: matrix
image: matrixdotorg/synapse:latest
restart_policy: unless-stopped
networks:
- name: matrix
published_ports:
- 8448:8448
env:
SYNAPSE_SERVER_NAME: "{{ matrix.domain }}"
SYNAPSE_REPORT_STATS: "False"
SYNAPSE_ENABLE_REGISTRATION: "True"
SYNAPSE_LOG_LEVEL: "INFO"
SYNAPSE_NO_TLS: "1"
POSTGRES_HOST: "matrix_db"
POSTGRES_USER: "synapse"
POSTGRES_PASSWORD: "{{ postgres_passwords.matrix }}"
VIRTUAL_HOST: "{{ matrix.domain }}"
VIRTUAL_PORT: "8008"
LETSENCRYPT_HOST: "{{ matrix.domain }}"
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
- name: riot container
docker_container:
name: riot_app
image: avhost/docker-matrix-riot
state: started
restart_policy: always
networks:
- name: matrix
- name: external_services
volumes:
- riot_app:/data
published_ports:
- 8080
env:
VIRTUAL_HOST: "{{ riot.domain }}"
VIRTUAL_PORT: "8080"
LETSENCRYPT_HOST: "{{ riot.domain }}"
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"