Сервис приложения
Сервисы/Mautic (buildable)

Сервис Mautic (buildable)

Mautic, собранный из вашего проекта Composer с устанавливаемыми им плагинами и темами, а также сопутствующие сервисы для cron и обработки очереди.

Этот сервис запускает ваш код: его образ собирается из Git-репозитория, а каждая сборка развёртывается в окружение.

В StackMaster

Как Mautic (buildable) работает в StackMaster

What Wodby sets up for Mautic on this service.

Image

The service runs the prebuilt wodby/mautic image: Mautic's recommended Composer project with its assets built, on the Apache variant of wodby/php. Apache serves Mautic and its .htaccess rules and passes PHP to PHP-FPM in the same container, on port 80. There is no build and no Git repository; a new image revision of the selected Mautic version brings Mautic's updates.

Plugins and themes can't be added to the image. Code changes to Mautic need a custom PHP application instead.

Settings

  • Database. DB_HOST, DB_PORT, DB_NAME, DB_USERNAME and DB_PASSWORD from the db link. Mautic supports MariaDB and MySQL only, and can't connect to a database server over TLS.
  • Address. Once Mautic is installed, its site URL is the app's main route (WODBY_PRIMARY_URL), or MAUTIC_SITE_URL when set. Links in email and cron output use it. A new main route takes effect when the service is redeployed; the site URL saved in Mautic's settings is ignored.
  • Proxies. The forwarded headers of proxies on private networks are trusted (MAUTIC_TRUSTED_PROXIES, default PRIVATE_SUBNETS), because TLS ends before the request reaches the container.

Data

The files volume is mounted at /mnt/files and shared by every replica and both workers through the linked storage service. It holds Mautic's settings file (config/local.php), uploaded files and images, language packs, CSV imports, logs and PHP sessions. Mautic's cache stays in each container. The database holds everything else.

config/local.php holds Mautic's secret key and every setting saved in Mautic. Losing it makes the database unusable to Mautic: back up the volume with the database.

Installation and upgrades

Mautic's web installer is not used, and the container doesn't serve it. On every deployment the Install or upgrade Mautic action runs mautic-update in a job of the new version, before its pods are replaced (on the first deployment, right after the install):

  • First deployment: it installs Mautic into the empty database. The administrator comes from the service's settings: admin-username (default admin, MAUTIC_ADMIN_USERNAME), admin-password (required, secret, at least 6 characters, MAUTIC_ADMIN_PASSWORD) and admin-email (required, MAUTIC_ADMIN_EMAIL).
  • Email is sent through the linked SMTP server (sendmail link), from the admin email and with the app's title as the sender name. Email and page hits are queued in the database for the queue worker. All of these can be changed in Mautic's settings later.
  • Without an admin password or email, the action fails and installs nothing.
  • The installer never runs over existing tables: if the database has tables but Mautic is not installed, for example after the settings file was lost, the action fails instead.
  • Later deployments: it runs bin/console doctrine:migrations:migrate and bin/console mautic:plugins:reload. The previous version keeps serving on the migrated database until the new one is ready. If the action fails, the deployment stops before the rollout.
  • Changing the admin settings after the first deployment does not change the account; change it in Mautic.

Workers

  • mautic-cron runs Mautic's cron jobs one after another and starts again five minutes after the previous start: mautic:segments:update, mautic:campaigns:update, mautic:campaigns:trigger, mautic:messages:send, mautic:broadcasts:send, mautic:import, mautic:contacts:scheduled_export, mautic:webhooks:process and mautic:reports:scheduler. A job that fails is logged and the next one runs. MAUTIC_CRON_INTERVAL and MAUTIC_CRON_COMMANDS change the interval and the jobs.
  • mautic-worker runs bin/console messenger:consume email hit; each run stops after an hour or 256 MB and the next one follows.
  • Both wait until Mautic is installed. On stop, the current job or message finishes first.

PHP settings

PHP-FPM runs as wodby, the owner of the code, like the console commands, so files any of them write stay writable by the others. max_execution_time is 300 seconds and uploads are limited to 64 MB; Mautic's own asset limit is 6 MB until you change it.

Limits

  • Mautic 7 on PHP 8.4. It needs MariaDB 10.11 or later or MySQL 8.4 or later.
  • No development workspace.

Check the result

  • Settings > System info shows Mautic's own checks, its folders and its logs.
  • php bin/console doctrine:migrations:status shows whether the database is up to date.
  • The deployment's log shows the install or upgrade output.
  • The mautic-cron and mautic-worker logs show each job and queue run.

Buildable Mautic on Wodby

This service is the mautic service built from the app's repository: its guidance applies to settings, data, workers, installation and updates. This page covers what differs.

Image

The image is built from the app's Git repository on top of wodby/mautic-php: PHP-FPM and Apache with the same Wodby setup as the prebuilt Mautic image, but no Mautic. The service's versions are PHP versions. The repository is a Mautic Composer project, started from the Mautic boilerplate, Mautic's recommended project with a composer.lock.

The build:

  • fails without composer.json and composer.lock, or with a committed config/local.php, Mautic's own settings file, which is kept in the files directory;
  • runs composer install --no-dev with Node.js available, so the project's Composer scripts install the npm packages and build Mautic's assets;
  • copies the result onto wodby/mautic-php and runs mautic-prepare-app, which adds Wodby's settings file and links the directories Mautic writes to the files volume, as in the prebuilt image.

Mautic's version comes from composer.lock: new image revisions bring PHP, Apache and Wodby's scripts, not a new Mautic. Updating Mautic means composer update "mautic/*" --with-all-dependencies, committing the lock file and deploying; the deployment runs the database migrations.

Plugins and themes

Plugins and themes are installed with Composer into docroot/plugins/ and docroot/themes/, or committed there. On every deployment the Install or upgrade Mautic action runs mautic-update before the new version rolls out, as the mautic service does, which ends with mautic:plugins:reload: plugins new in the repository are registered and installed ones are updated.

Workers

The mautic-buildable-cron and mautic-buildable-worker workers run the app's own image, so the repository's plugins are loaded there too.

Обзор

Технический профиль Mautic (buildable)

Здесь перечислены версии, которые можно выбрать для Mautic (buildable) в стеке или окружении. Сам сервис публикуется ревизиями, и стек ссылается на конкретную ревизию.

Тип сервиса

Сервис приложения

Версии

8.4

Постоянные тома

Files

Стеки

Стеки, в которые входит Mautic (buildable)

Mautic (buildable) входит в этот публичный стек. Можно создать приложение из публичного стека как есть или добавить сервис в собственный стек.

CI/CD

Сборка Mautic (buildable) из Git-репозитория

Начните с публичного шаблона проекта или подключите собственный репозиторий. В StackMaster CI push в ветку, за которой следит окружение, запускает сборку Mautic (buildable), а пайплайн её развёртывает.

Vanilla Mautic

Используйте его как есть или клонируйте в свой Git-аккаунт.

wodby/mautic-boilerplate

Git-провайдеры

Репозиторий подключается через интеграцию с его Git-провайдером.

CI-провайдеры

StackMaster CI встроен в платформу: пайплайн описывается в файле .wodby/pipeline.yml в репозитории. Для подключённого репозитория те же шаги может выполнять внешний CI-провайдер с помощью StackMaster CLI.

Реестры контейнеров

Собранные образы по умолчанию попадают в StackMaster Registry или во внешний реестр, подключённый как интеграция.

Переменные окружения из интеграций

Интеграция с переменными один раз сохраняет учётные данные стороннего сервиса. Подключите её к Mautic (buildable), и StackMaster передаст их в контейнер как переменные окружения во время работы, а не при сборке образа.

Конфигурация

Конфигурация сервиса Mautic (buildable)

Сервис Mautic (buildable) объявляет следующее. Если значение можно изменить, его задаёт стек, а каждое окружение может его переопределить.

Технические домены

StackMaster выдаёт каждому публичному HTTP-порту технический домен с TLS-сертификатом и продлевает сертификат. Порт, который сервис помечает как частный, домен не получает. Можно добавить собственные домены.

Тома

Files

Настройки

3 настройки, которые стек или окружение могут изменить.

Действия

1 действие. Действие — это команда, которую вы запускаете из панели управления или которую StackMaster выполняет после развёртывания или обновления стека.

Связи сервиса

Каждая связь — это подключение Mautic (buildable) к другому сервису. На какой сервис указывает связь, задаёт стек. На карточках перечислены публичные сервисы, которые подходят для каждой связи.

sendmail

Сервисы, которые подходят для этой связи