mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 13:46:59 +01:00
Add matrix, plex and deluge
This commit is contained in:
parent
643ab3229a
commit
b09ac86a62
24 changed files with 390 additions and 1 deletions
1
roles/matrix-docker/defaults/main.yml
Normal file
1
roles/matrix-docker/defaults/main.yml
Normal file
|
|
@ -0,0 +1 @@
|
|||
---
|
||||
43
roles/matrix-docker/files/matrix/docker-compose.yml
Normal file
43
roles/matrix-docker/files/matrix/docker-compose.yml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
version: "2"
|
||||
services:
|
||||
db:
|
||||
image: postgres:9.6
|
||||
restart: always
|
||||
# Adding 127.0.0.1 ensures the port isn't exposed ON the host
|
||||
ports:
|
||||
- "127.0.0.1:5432:5432"
|
||||
volumes:
|
||||
- /var/lib/matrix/db:/var/lib/postgresql/data
|
||||
- /backups/matrix:/backups
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=synapse
|
||||
- POSTGRES_USER=synapse
|
||||
networks:
|
||||
- matrix
|
||||
|
||||
synapse:
|
||||
image: silviof/docker-matrix
|
||||
ports:
|
||||
- "127.0.0.1:8008:8008"
|
||||
- "8448:8448"
|
||||
- "3478:3478"
|
||||
environment:
|
||||
- VIRTUAL_HOST=matrix.banditlair.com
|
||||
- VIRTUAL_NETWORK=nginx-proxy
|
||||
- VIRTUAL_PORT=8008
|
||||
volumes:
|
||||
- /var/lib/matrix/media_store:/data/media_store
|
||||
- /var/log/synapse:/data/log
|
||||
- ./synapse:/data
|
||||
networks:
|
||||
- matrix
|
||||
- proxy-tier
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
matrix:
|
||||
external:
|
||||
name: matrix-network
|
||||
proxy-tier:
|
||||
external:
|
||||
name: nginx-proxy
|
||||
2
roles/matrix-docker/meta/main.yml
Normal file
2
roles/matrix-docker/meta/main.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
dependencies:
|
||||
- nginx-proxy-docker
|
||||
24
roles/matrix-docker/tasks/main.yml
Normal file
24
roles/matrix-docker/tasks/main.yml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
- name: Copy matrix docker files
|
||||
copy:
|
||||
src: matrix
|
||||
dest: "{{docker_compose_files_folder}}"
|
||||
- name: Create matrix-network docker network
|
||||
docker_network:
|
||||
name: matrix-network
|
||||
- name: Start matrix docker project
|
||||
docker_service:
|
||||
project_src: "{{docker_compose_files_folder}}/matrix"
|
||||
state: present
|
||||
- name: Check if database tables exist
|
||||
command: docker-compose exec -T db psql -U synapse synapse -c "\dt"
|
||||
args:
|
||||
chdir: "{{docker_compose_files_folder}}/matrix/"
|
||||
register: db_tables_exist
|
||||
ignore_errors: false
|
||||
changed_when: '"No relations found." in db_tables_exist.stdout_lines'
|
||||
- name: Restore Matrix database
|
||||
command: docker-compose exec -T db sh -c "psql -U synapse synapse < /backups/database.dmp"
|
||||
args:
|
||||
chdir: "{{docker_compose_files_folder}}/matrix/"
|
||||
when: '"No relations found." in db_tables_exist.stdout_lines'
|
||||
Loading…
Add table
Add a link
Reference in a new issue