Rewrite matrix/riot to use docker_service

This commit is contained in:
Jesper Hess 2019-03-15 18:56:27 +01:00
parent ada37f206a
commit 1f69fdc3b4
Signed by: graffen
GPG key ID: 351A89E40D763F0F

View file

@ -26,10 +26,6 @@
loop_control:
loop_var: volume
- name: matrix network
docker_network:
name: matrix
- name: upload riot config.json
template:
src: files/configs/riot/config.json
@ -60,32 +56,37 @@
src: "files/configs/matrix/matrix.data.coop.log.config"
dest: "{{ matrix.volume_folder }}/data/matrix.data.coop.log.config"
- name: matrix database container
docker_container:
name: matrix_db
- name: set up matrix and riot
docker_service:
project_name: matrix
pull: yes
definition:
version: "3.6"
services:
matrix_db:
container_name: matrix_db
image: postgres:10
state: started
restart_policy: always
restart: unless-stopped
networks:
- name: matrix
- matrix
volumes:
- "{{ matrix.volume_folder }}/db:/var/lib/postgresql/data"
env:
environment:
POSTGRES_USER: "synapse"
POSTGRES_PASSWORD: "{{ postgres_passwords.matrix }}"
- name: matrix container
docker_container:
name: matrix
matrix_app:
container_name: matrix
image: matrixdotorg/synapse:v0.99.2
restart_policy: unless-stopped
restart: unless-stopped
networks:
- name: matrix
published_ports:
- "8008"
- matrix
- external_services
ports:
- 8008
volumes:
- "{{ matrix.volume_folder }}/data:/data"
env:
environment:
SYNAPSE_CONFIG_PATH: "/data/homeserver.yaml"
SYNAPSE_LOG_LEVEL: "INFO"
VIRTUAL_HOST: "{{ matrix.domain }}"
@ -93,21 +94,26 @@
LETSENCRYPT_HOST: "{{ matrix.domain }}"
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
- name: riot container
docker_container:
name: riot_app
riot:
container_name: riot_app
image: avhost/docker-matrix-riot:v1.0.3
state: started
restart_policy: always
restart: unless-stopped
networks:
- name: matrix
- name: external_services
published_ports:
- "8080"
- matrix
- external_services
ports:
- 8080
volumes:
- "{{ riot.volume_folder }}/data:/data"
env:
environment:
VIRTUAL_HOST: "{{ riot.domain }}"
VIRTUAL_PORT: "8080"
LETSENCRYPT_HOST: "{{ riot.domain }}"
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
networks:
external_services:
external:
name: external_services
matrix:
name: "matrix"