Further optimations of espocrm

This commit is contained in:
2025-04-25 17:22:05 +02:00
parent 87262f7373
commit 4958b08ca7
15 changed files with 153 additions and 82 deletions

View File

@@ -5,52 +5,41 @@ services:
web:
image: espocrm/espocrm:{{ applications.espocrm.version }}
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
environment:
# --- DB connection ----------------------------------------------------
- ESPOCRM_DATABASE_PLATFORM=Mysql
- ESPOCRM_DATABASE_HOST={{ database_host }}
- ESPOCRM_DATABASE_PORT={{ database_port }}
- ESPOCRM_DATABASE_NAME={{ database_name }}
- ESPOCRM_DATABASE_USER={{ database_username }}
- ESPOCRM_DATABASE_PASSWORD={{ database_password }}
# --- initial admin & site URL ----------------------------------------
- ESPOCRM_ADMIN_USERNAME={{ applications[application_id].credentials.admin.username }}
- ESPOCRM_ADMIN_PASSWORD={{ applications[application_id].credentials.admin.password }}
- ESPOCRM_SITE_URL={{ web_protocol }}://{{ domains[application_id] }}
command: "php-fpm"
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/depends-on-just-database.yml.j2' %}
{% include 'templates/docker/container/networks.yml.j2' %}
volumes:
- data:/var/www/html
daemon:
image: espocrm/espocrm:{{ applications.espocrm.version }}
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
restart: {{docker_restart_policy}}
logging:
driver: journald
entrypoint: docker-daemon.sh
{% include 'templates/docker/container/depends-on-database.yml.j2' %}
{% include 'templates/docker/container/networks.yml.j2' %}
volumes:
- data:/var/www/html
restart: unless-stopped
websocket:
image: espocrm/espocrm:{{ applications.espocrm.version }}
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
restart: {{docker_restart_policy}}
logging:
driver: journald
environment:
- ESPOCRM_CONFIG_USE_WEB_SOCKET=true
- ESPOCRM_CONFIG_WEB_SOCKET_URL=ws://{{ domains[application_id] }}/ws
- ESPOCRM_CONFIG_WEB_SOCKET_ZERO_M_Q_SUBSCRIBER_DSN=tcp://*:7777
- ESPOCRM_CONFIG_WEB_SOCKET_ZERO_M_Q_SUBMISSION_DSN=tcp://websocket:7777
entrypoint: docker-websocket.sh
{% include 'templates/docker/container/depends-on-database.yml.j2' %}
{% include 'templates/docker/container/depends-on-just-database.yml.j2' %}
{% include 'templates/docker/container/networks.yml.j2' %}
volumes:
- data:/var/www/html
restart: unless-stopped
ports:
- "{{ ports.localhost.websocket[application_id] | default('127.0.0.1:8081') }}:8080"

View File

@@ -1,44 +1,98 @@
# EspoCRM environment
#############################################
# EspoCRM Docker Environment (.env) ENGLISH
# See: https://hub.docker.com/r/espocrm/espocrm
#############################################
# ------------------------------------------------
# Database connection
# ------------------------------------------------
ESPOCRM_DATABASE_PLATFORM=Mysql
ESPOCRM_DATABASE_HOST={{ database_host }}
ESPOCRM_DATABASE_PORT={{ database_port }}
ESPOCRM_DATABASE_NAME={{ database_name }}
ESPOCRM_DATABASE_USER={{ database_username }}
ESPOCRM_DATABASE_PASSWORD={{ database_password }}
# Cron toggle
# Disable EspoCRMs built-in cron (handled externally)
CRON_DISABLED=true
ESPOCRM_ADMIN_USERNAME: admin
ESPOCRM_ADMIN_PASSWORD: password
ESPOCRM_SITE_URL: "http://localhost:8080"
# ------------------------------------------------
# Initial admin account
# ------------------------------------------------
ESPOCRM_ADMIN_USERNAME={{ applications[application_id].users.administrator.username }}
ESPOCRM_ADMIN_PASSWORD={{ applications[application_id].credentials.administrator.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
# Public base URL of the EspoCRM instance
ESPOCRM_SITE_URL={{ web_protocol }}://{{ domains[application_id] }}
###################################
# ------------------------------------------------
# General UI & locale settings
# ------------------------------------------------
ESPOCRM_CONFIG_LANGUAGE={{ HOST_LL_CC }}
ESPOCRM_CONFIG_DATE_FORMAT={{ HOST_DATE_FORMAT }}
ESPOCRM_CONFIG_TIME_FORMAT={{ HOST_TIME_FORMAT }}
ESPOCRM_CONFIG_TIME_ZONE={{ HOST_TIMEZONE }}
# ESPOCRM_CONFIG_WEEK_START: 0 = Sunday, 1 = Monday
ESPOCRM_CONFIG_WEEK_START=1
ESPOCRM_CONFIG_DEFAULT_CURRENCY={{ HOST_CURRENCY }}
ESPOCRM_CONFIG_THOUSAND_SEPARATOR={{ HOST_THOUSAND_SEPARATOR }}
ESPOCRM_CONFIG_DECIMAL_MARK={{HOST_DECIMAL_MARK}}
# ------------------------------------------------
# Logger
# ------------------------------------------------
ESPOCRM_CONFIG_LOGGER_LEVEL={{ 'DEBUG' if enable_debug | bool else 'INFO' }}
ESPOCRM_CONFIG_LOGGER_PATH=php://stdout
ESPOCRM_CONFIG_LOGGER_ROTATION=false
# ------------------------------------------------
# System SMTP settings
# ------------------------------------------------
ESPOCRM_CONFIG_SMTP_SERVER={{ system_email.host }}
ESPOCRM_CONFIG_SMTP_PORT={{ system_email.port }}
ESPOCRM_CONFIG_SMTP_SECURITY=TLS
ESPOCRM_CONFIG_SMTP_AUTH=true
ESPOCRM_CONFIG_SMTP_USERNAME={{ users['no-reply'].email }}
ESPOCRM_CONFIG_SMTP_PASSWORD={{ users['no-reply'].mailu_token }}
ESPOCRM_CONFIG_OUTBOUND_EMAIL_FROM_NAME={{ service_provider.company.titel }} - CRM
ESPOCRM_CONFIG_OUTBOUND_EMAIL_FROM_ADDRESS={{ users['no-reply'].email }}
# ------------------------------------------------
# LDAP settings (optional)
###################################
# Applied only if the feature flag is true
# ------------------------------------------------
{% 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 }}
ESPOCRM_CONFIG_AUTHENTICATION_METHOD=Ldap
ESPOCRM_CONFIG_LDAP_HOST={{ ldap.server.domain }}
ESPOCRM_CONFIG_LDAP_PORT={{ ldap.server.port }}
# ESPOCRM_CONFIG_LDAP_SECURITY: "", SSL or TLS
ESPOCRM_CONFIG_LDAP_SECURITY=
ESPOCRM_CONFIG_LDAP_USERNAME={{ ldap.dn.administrator }}
ESPOCRM_CONFIG_LDAP_PASSWORD={{ ldap.bind_credential }}
ESPOCRM_CONFIG_LDAP_BASE_DN={{ ldap.dn.users }}
ESPOCRM_CONFIG_LDAP_USER_LOGIN_FILTER=(sAMAccountName=%USERNAME%)
{% endif %}
###################################
# OpenID Connect (OIDC) settings (optional)
###################################
# ------------------------------------------------
# OpenID Connect settings (optional)
# Applied only if the feature flag is true
# ------------------------------------------------
{% 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 %}
# ------------------------------------------------
# OpenID Connect settings
# ------------------------------------------------
ESPOCRM_CONFIG_AUTHENTICATION_METHOD=Oidc
ESPOCRM_CONFIG_OIDC_FALLBACK=false # set true if you want LDAP as fallback
ESPOCRM_CONFIG_OIDC_CLIENT_ID={{ oidc.client.id }}
ESPOCRM_CONFIG_OIDC_CLIENT_SECRET={{ oidc.client.secret }}
ESPOCRM_CONFIG_OIDC_AUTHORIZATION_ENDPOINT={{ oidc.client.authorize_url }}
ESPOCRM_CONFIG_OIDC_TOKEN_ENDPOINT={{ oidc.client.token_url }}
ESPOCRM_CONFIG_OIDC_USER_INFO_ENDPOINT={{ oidc.client.user_info_url }}
ESPOCRM_CONFIG_OIDC_JWKS_ENDPOINT={{ oidc.client.certs }}
ESPOCRM_CONFIG_OIDC_AUTHORIZATION_REDIRECT_URI=https://{{ domains[application_id] }}/oidc/callback
ESPOCRM_CONFIG_OIDC_SCOPES=openid,profile,email
{% endif %}