Skip to content
Snippets Groups Projects
Commit a3068b00 authored by jurgenhaas's avatar jurgenhaas
Browse files

Update to run behind traefik proxy

parent cdf74c1d
No related branches found
No related tags found
No related merge requests found
---
# file: roles/plantuml/handlers/main.yml
- name: Re-create the plantuml container
docker_container:
name: plantuml
image: plantuml/plantuml-server
init: yes
state: started
recreate: yes
restart_policy: always
ports:
- '8025:8080'
---
# file: roles/plantuml/tasks/install.yml
- block:
- name: Set facts
set_fact:
appRoot: /apps/plantuml/{{ plantuml.id }}
tags:
- always
- name: Ensure Directories
file:
path: '{{ item }}'
state: directory
with_items:
- '{{ appRoot }}'
- name: Docker compose file
template:
src: docker-compose.yml
dest: '{{ appRoot }}/docker-compose.yml'
mode: 0664
- name: Start Docker containers
shell: docker compose {{ item }}
args:
chdir: '{{ appRoot }}'
with_items:
- pull --quiet
- up -d
......@@ -13,8 +13,12 @@
- block:
- name: Import plantuml
import_tasks: plantuml.yml
- name: Install Plantuml
include_tasks: install.yml
with_items: '{{ plantuml_settings|default([]) }}'
loop_control:
loop_var: plantuml
when: limit_site is not defined or limit_site == 'no' or plantuml.id is not defined or limit_site == plantuml.id
- name: Remember that this role had been run
set_fact:
......
---
# file: roles/plantuml/tasks/plantuml.yml
- name: Pull docker image
docker_image:
name: plantuml/plantuml-server
source: pull
force_source: yes
notify:
- Re-create the plantuml container
version: '3.3'
name: plantuml_{{ plantuml.id }}
networks:
traefik-public:
external: true
services:
app:
image: plantuml/plantuml-server:latest
restart: unless-stopped
networks:
- traefik-public
- default
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
labels:
traefik.enable: 'true'
traefik.docker.network: traefik-public
traefik.http.services.plantuml_{{ plantuml.id }}.loadbalancer.server.port: 8080
traefik.http.routers.plantuml_{{ plantuml.id }}.rule: Host(`{{ plantuml.domain }}`)
traefik.http.routers.plantuml_{{ plantuml.id }}.tls: 'true'
traefik.http.routers.plantuml_{{ plantuml.id }}.tls.certresolver: lakedrops
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment