Implemented espocrm draft

This commit is contained in:
2025-04-25 12:34:09 +02:00
parent 79d6a68dc1
commit edf2be504c
12 changed files with 201 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
services:
{% include 'roles/docker-central-database/templates/services/' + database_type + '.yml.j2' %}
web:
image: espocrm/espocrm:{{ applications.espocrm.version }}
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
environment:
- DATABASE_HOST={{ database_host }}
- DATABASE_PORT={{ database_port }}
- DATABASE_NAME={{ database_name }}
- DATABASE_USER={{ database_username }}
- DATABASE_PASSWORD={{ database_password }}
- CRON=disable # cron handled by separate service
command: apache2-foreground
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/" ]
ports:
- "127.0.0.1:{{ ports.localhost.http[application_id] }}:80"
{% include 'templates/docker/container/depends-on-database.yml.j2' %}
{% include 'templates/docker/container/networks.yml.j2' %}
volumes:
- data:/var/www/html
cron:
image: espocrm/espocrm:{{ applications.espocrm.version }}
command: /usr/local/bin/cron.sh
restart: unless-stopped
{% include 'templates/docker/container/depends-on-database.yml.j2' %}
volumes:
- data:/var/www/html
{% include 'templates/docker/container/networks.yml.j2' %}
healthcheck:
test: ["CMD", "pgrep", "cron"]
{% include 'templates/docker/compose/volumes.yml.j2' %}
data:
{% include 'templates/docker/compose/networks.yml.j2' %}

View File

@@ -0,0 +1,38 @@
# EspoCRM environment
# Database connection
DATABASE_HOST={{ database_host }}
DATABASE_PORT={{ database_port }}
DATABASE_NAME={{ database_name }}
DATABASE_USER={{ database_username }}
DATABASE_PASSWORD={{ database_password }}
# SMTP settings (example)
SMTP_HOST={{ system_email.host }}
SMTP_PORT={{ system_email.port }}
SMTP_USER={{ users['no-reply'].email }}
SMTP_PASS={{ users['no-reply'].mailu_token }}
SMTP_SECURE=tls
###################################
# LDAP settings (optional)
###################################
{% if applications[application_id].features.ldap | bool %}
LDAP_ENABLED=true
LDAP_HOST={{ ldap.server.domain }}
LDAP_PORT={{ ldap.server.port }}
LDAP_BASE_DN={{ ldap.dn.users }}
LDAP_BIND_DN={{ ldap.dn.administrator }}
LDAP_BIND_PASSWORD={{ ldap.bind_credential }}
LDAP_UID_ATTRIBUTE={{ ldap.attributes.user_id }}
{% endif %}
###################################
# OpenID Connect (OIDC) settings (optional)
###################################
{% if applications[application_id].features.oidc | bool %}
OIDC_ENABLED=true
OIDC_ISSUER_URL={{ oidc.client.issuer_url }}
OIDC_CLIENT_ID={{ oidc.client.id }}
OIDC_CLIENT_SECRET={{ oidc.client.secret }}
OIDC_REDIRECT_URI=https://{{ domains[application_id] }}/oidc/callback
{% endif %}