From ba5bc3b1cd3271a2b325d17f231bc5077a304cd6 Mon Sep 17 00:00:00 2001 From: Phil Date: Mon, 11 Nov 2024 11:58:14 -0700 Subject: [PATCH] add heyform to stack --- roles/docker/files/Caddyfile | 4 ++ roles/docker/tasks/heyform.yml | 19 ++++++++ roles/docker/tasks/main.yml | 6 ++- roles/docker/templates/heyform-compose.yml.j2 | 45 +++++++++++++++++++ 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 roles/docker/tasks/heyform.yml create mode 100644 roles/docker/templates/heyform-compose.yml.j2 diff --git a/roles/docker/files/Caddyfile b/roles/docker/files/Caddyfile index 873bf93..8aa2e35 100644 --- a/roles/docker/files/Caddyfile +++ b/roles/docker/files/Caddyfile @@ -73,3 +73,7 @@ repair.nerder.land { root * /srv/repair file_server } + +forms.nerder.land { + reverse_proxy heyform-heyform-1:8000 +} diff --git a/roles/docker/tasks/heyform.yml b/roles/docker/tasks/heyform.yml new file mode 100644 index 0000000..d14efd8 --- /dev/null +++ b/roles/docker/tasks/heyform.yml @@ -0,0 +1,19 @@ +- name: make heyform directories + ansible.builtin.file: + path: "{{ item}}" + state: directory + loop: + - /opt/stacks/heyform + +- name: Template out the compose file + ansible.builtin.template: + src: heyform-compose.yml.j2 + dest: /opt/stacks/heyform/compose.yml + owner: root + mode: 644 + +- name: deploy heyform stack + community.docker.docker_compose_v2: + project_src: /opt/stacks/heyform + files: + - compose.yml \ No newline at end of file diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index 9ba7e3a..06cc607 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -120,4 +120,8 @@ - name: Install paperlessngx import_tasks: paperlessngx.yml - tags: paperlessngx \ No newline at end of file + tags: paperlessngx + +- name: Install heyform + import_tasks: heyform.yml + tags: heyform \ No newline at end of file diff --git a/roles/docker/templates/heyform-compose.yml.j2 b/roles/docker/templates/heyform-compose.yml.j2 new file mode 100644 index 0000000..2ab4d73 --- /dev/null +++ b/roles/docker/templates/heyform-compose.yml.j2 @@ -0,0 +1,45 @@ +services: + heyform: + image: heyform/community-edition:latest + restart: always + volumes: + # Persist uploaded images + - assets:/app/static/upload + depends_on: + - mongo + - keydb + environment: + APP_HOMEPAGE_URL: http://forms.nerder.land + SESSION_KEY: {{ heyform_session_key }} + FORM_ENCRYPTION_KEY: {{ heyform_encryption_key }} + MONGO_URI: 'mongodb://mongo:27017/heyform' + REDIS_HOST: keydb + REDIS_PORT: 6379 + + mongo: + image: percona/percona-server-mongodb:4.4 + restart: always + volumes: + # Persist MongoDB data + - database:/data/db + + keydb: + image: eqalpha/keydb:latest + restart: always + command: keydb-server --appendonly yes + volumes: + # Persist KeyDB data + - keydb:/data + +volumes: + assets: + driver: local + database: + driver: local + keydb: + driver: local + +networks: + default: + external: true + name: lava \ No newline at end of file