feat: add drawio instance for nextcloud and opencloud
Signed-off-by: Bert-Jan Fikse <bert-jan@whatwedo.ch>
This commit is contained in:
parent
f3f2b6d5b7
commit
910986b808
11 changed files with 152 additions and 4 deletions
|
|
@ -1,3 +1,20 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
# defaults file for drawio
|
||||
|
||||
# Base directory configuration (inherited from base role or defined here)
|
||||
docker_compose_base_dir: /etc/docker/compose
|
||||
|
||||
# Drawio-specific configuration
|
||||
drawio_service_name: drawio
|
||||
drawio_docker_compose_dir: "{{ docker_compose_base_dir }}/{{ drawio_service_name }}"
|
||||
|
||||
# Service configuration
|
||||
drawio_domain: "drawio.local.test"
|
||||
drawio_image: "jgraph/drawio:latest"
|
||||
drawio_port: 8080
|
||||
drawio_extra_hosts: []
|
||||
|
||||
# Traefik configuration
|
||||
drawio_traefik_network: "proxy"
|
||||
drawio_use_ssl: true
|
||||
|
|
@ -1,3 +1,8 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
# handlers file for drawio
|
||||
|
||||
- name: restart drawio
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ drawio_docker_compose_dir }}"
|
||||
state: restarted
|
||||
|
|
@ -1,3 +1,21 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
# tasks file for drawio
|
||||
|
||||
- name: Create docker compose directory
|
||||
file:
|
||||
path: "{{ drawio_docker_compose_dir }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Create docker-compose file for drawio
|
||||
template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: "{{ drawio_docker_compose_dir }}/docker-compose.yml"
|
||||
mode: '0644'
|
||||
notify: restart drawio
|
||||
|
||||
- name: Start drawio container
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ drawio_docker_compose_dir }}"
|
||||
state: present
|
||||
28
roles/drawio/templates/docker-compose.yml.j2
Normal file
28
roles/drawio/templates/docker-compose.yml.j2
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
services:
|
||||
drawio:
|
||||
image: {{ drawio_image }}
|
||||
container_name: {{ drawio_service_name }}
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- {{ drawio_traefik_network }}
|
||||
{% if drawio_extra_hosts is defined and drawio_extra_hosts | length > 0 %}
|
||||
extra_hosts:
|
||||
{% for host in drawio_extra_hosts %}
|
||||
- "{{ host }}"
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.docker.network={{ drawio_traefik_network }}
|
||||
- traefik.http.routers.{{ drawio_service_name }}.rule=Host(`{{ drawio_domain }}`)
|
||||
- traefik.http.services.{{ drawio_service_name }}.loadbalancer.server.port={{ drawio_port }}
|
||||
{% if drawio_use_ssl %}
|
||||
- traefik.http.routers.{{ drawio_service_name }}.entrypoints=websecure
|
||||
- traefik.http.routers.{{ drawio_service_name }}.tls=true
|
||||
{% else %}
|
||||
- traefik.http.routers.{{ drawio_service_name }}.entrypoints=web
|
||||
{% endif %}
|
||||
|
||||
networks:
|
||||
{{ drawio_traefik_network }}:
|
||||
external: true
|
||||
Loading…
Add table
Add a link
Reference in a new issue