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 untrusted user: graffen
GPG Key ID: 351A89E40D763F0F
1 changed files with 59 additions and 53 deletions

View File

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