add Excalidraw Container
This commit is contained in:
parent
0549ced53b
commit
928e83e8f9
8 changed files with 86 additions and 0 deletions
|
@ -35,4 +35,9 @@
|
||||||
- role: deploy_container_wishlist
|
- role: deploy_container_wishlist
|
||||||
tags:
|
tags:
|
||||||
- wishlist
|
- wishlist
|
||||||
|
- docker-container
|
||||||
|
|
||||||
|
- role: deploy_container_excalidraw
|
||||||
|
tags:
|
||||||
|
- excalidraw
|
||||||
- docker-container
|
- docker-container
|
3
roles/deploy_container_excalidraw/defaults/main.yml
Normal file
3
roles/deploy_container_excalidraw/defaults/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
container_excalidraw_version: latest
|
||||||
|
container_excalidraw_domain: excalidraw.example.com
|
||||||
|
container_excalidraw_directory: /opt/docker/excalidraw
|
0
roles/deploy_container_excalidraw/handlers/main.yml
Normal file
0
roles/deploy_container_excalidraw/handlers/main.yml
Normal file
0
roles/deploy_container_excalidraw/meta/main.yml
Normal file
0
roles/deploy_container_excalidraw/meta/main.yml
Normal file
39
roles/deploy_container_excalidraw/tasks/main.yml
Normal file
39
roles/deploy_container_excalidraw/tasks/main.yml
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
---
|
||||||
|
- name: Ensure data directories exist
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ container_excalidraw_directory }}/data/{{ item }}"
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
loop:
|
||||||
|
- "app"
|
||||||
|
- "node_modules"
|
||||||
|
- "app"
|
||||||
|
- "app"
|
||||||
|
become: false
|
||||||
|
|
||||||
|
- name: Create neccessary Files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ traefik_container_dir }}/data/{{ item }}"
|
||||||
|
state: touch
|
||||||
|
mode: '0644'
|
||||||
|
loop:
|
||||||
|
- "package.json"
|
||||||
|
- "yarn.lock"
|
||||||
|
become: false
|
||||||
|
|
||||||
|
- name: Deploy Docker Compose and .env files
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: "{{ item.src }}"
|
||||||
|
dest: "{{ container_excalidraw_directory }}/{{ item.dest }}"
|
||||||
|
mode: '0644'
|
||||||
|
loop:
|
||||||
|
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
||||||
|
- { src: '.env.j2', dest: '.env' }
|
||||||
|
become: false
|
||||||
|
|
||||||
|
- name: Start Container
|
||||||
|
community.docker.docker_compose_v2:
|
||||||
|
project_src: "{{ container_excalidraw_directory }}"
|
||||||
|
pull: always
|
||||||
|
docker_host: "unix:///run/user/1000/docker.sock"
|
||||||
|
become: false
|
5
roles/deploy_container_excalidraw/templates/.env.j2
Normal file
5
roles/deploy_container_excalidraw/templates/.env.j2
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Excalidraw Version (Standard: latest) # Excalidraw Version (Standard: latest)
|
||||||
|
EXCALIDRAW_VERSION={{ container_excalidraw_version }}
|
||||||
|
|
||||||
|
# Excalidraw Domain
|
||||||
|
EXCALIDRAW_DOMAIN={{ container_excalidraw_domain }}
|
|
@ -0,0 +1,34 @@
|
||||||
|
---
|
||||||
|
services:
|
||||||
|
excalidraw:
|
||||||
|
image: excalidraw/excalidraw:${EXCALIDRAW_VERSION:-latest}
|
||||||
|
container_name: excalidraw
|
||||||
|
restart: on-failure
|
||||||
|
stdin_open: true
|
||||||
|
healthcheck:
|
||||||
|
disable: true
|
||||||
|
environment:
|
||||||
|
- NODE_ENV=development
|
||||||
|
networks:
|
||||||
|
- traefik
|
||||||
|
volumes:
|
||||||
|
- ./data/app:/opt/node_app/app:delegated
|
||||||
|
- ./data/package.json:/opt/node_app/package.json
|
||||||
|
- ./data/yarn.lock:/opt/node_app/yarn.lock
|
||||||
|
- ./data/node_modules:/opt/node_app/app/node_modules
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.docker.network=traefik"
|
||||||
|
- "traefik.http.routers.excalidraw.entrypoints=http"
|
||||||
|
- "traefik.http.routers.excalidraw.rule=Host(`${EXCALIDRAW_DOMAIN:?error}`)"
|
||||||
|
- "traefik.http.middlewares.excalidraw-https-redirect.redirectscheme.scheme=https"
|
||||||
|
- "traefik.http.routers.excalidraw.middlewares=excalidraw-https-redirect"
|
||||||
|
- "traefik.http.routers.excalidraw-secure.entrypoints=https"
|
||||||
|
- "traefik.http.routers.excalidraw-secure.rule=Host(`${EXCALIDRAW_DOMAIN:?error}`)"
|
||||||
|
- "traefik.http.routers.excalidraw-secure.tls=true"
|
||||||
|
- "traefik.http.routers.excalidraw-secure.service=excalidraw"
|
||||||
|
- "traefik.http.services.excalidraw.loadbalancer.server.port=80"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
traefik:
|
||||||
|
external: true
|
0
roles/deploy_container_excalidraw/vars/main.yml
Normal file
0
roles/deploy_container_excalidraw/vars/main.yml
Normal file
Loading…
Add table
Reference in a new issue