Refactored ws implementation to use it in mastodon and in new espocrm role

This commit is contained in:
2025-04-25 14:44:33 +02:00
parent 4e04f882e5
commit 87262f7373
26 changed files with 173 additions and 91 deletions

View File

@@ -1,27 +1,26 @@
# ./roles/docker-espocrm/tasks/main.yml
---
- name: "include docker-central-database"
include_role:
name: docker-central-database
# -- Nginx reverse proxy and Let's Encrypt certificates (same pattern as the Gitea role) --
- name: "include role nginx-domain-setup for {{ application_id }}"
include_role:
- name: "Include setup for domain '{{ domain }}'"
include_role:
name: nginx-domain-setup
vars:
domain: "{{ domains[application_id] }}"
http_port: "{{ ports.localhost.http[application_id] }}"
ws_path: "/ws"
ws_port: "{{ ports.localhost.websocket[application_id] }}"
client_max_body_size: "100m"
vhost_flavour: "ws_generic"
domain: "{{ domains[application_id] }}"
http_port: "{{ ports.localhost.http[application_id] }}"
# -- Copy docker-compose.yml and .env --
- name: "copy docker-compose.yml and env file"
include_tasks: copy-docker-compose-and-env.yml
# -- Ensure containers are (re)started after the initial setup --
- name: flush docker service
meta: flush_handlers
when: applications.espocrm.setup | bool
# -- Run database initialisation or upgrade --
- name: "run database setup / upgrade"
command:
cmd: "docker compose run --rm web php command.php upgrade"

View File

@@ -7,7 +7,7 @@ services:
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
environment:
# --- DB connection ----------------------------------------------------
- ESPOCRM_DATABASE_PLATFORM=Mysql # EspoCRM expects Mysql even for MariaDB
- ESPOCRM_DATABASE_PLATFORM=Mysql
- ESPOCRM_DATABASE_HOST={{ database_host }}
- ESPOCRM_DATABASE_PORT={{ database_port }}
- ESPOCRM_DATABASE_NAME={{ database_name }}
@@ -27,7 +27,7 @@ services:
volumes:
- data:/var/www/html
daemon: # ↔ was “espocrm-daemon” in the example
daemon:
image: espocrm/espocrm:{{ applications.espocrm.version }}
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
entrypoint: docker-daemon.sh
@@ -37,7 +37,7 @@ services:
- data:/var/www/html
restart: unless-stopped
websocket: # ↔ was “espocrm-websocket” in the example
websocket:
image: espocrm/espocrm:{{ applications.espocrm.version }}
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
environment:
@@ -57,4 +57,4 @@ services:
{% include 'templates/docker/compose/volumes.yml.j2' %}
data:
{% include 'templates/docker/compose/networks.yml.j2' %}
{% include 'templates/docker/compose/networks.yml.j2' %}