mautic / docker-mautic

Docker Image for Mautic
https://www.mautic.org
381 stars 280 forks source link
docker-image mautic

Mautic Docker image and examples

[!NOTE] This version refers to Docker images and examples for Mautic 5. If you would like information about older versions, see https://github.com/mautic/docker-mautic/tree/mautic4.

Versions

all Mautic 5 Docker images follow the following naming stategy.

<major.minor.patch>-<variant>

There are some defaults if parts are omitted:

some examples:

Variants

The Docker images exist in 2 variants:

The latest supported Mautic PHP version is used the moment of generating of the image.

Each variant contains:

See the examples explanation below how you could use them.

Roles

each image can be started in 3 modes:

This allows you to use different scaling strategies to run the workers or crons, without having to maintain separate images.
The mautic_cron and mautic_worker require the codebase anyhow, as they execute console commands that need to bootstrap the full application.

Examples

The examples folder contains examples of docker-compose setups that use the Docker images.

[!WARNING] The examples require docker compose v2.
Running the examples with the unsupported docker-compose v1 will result in a non-starting web container.

[!IMPORTANT] Please take into account the purpose of those examples:
it shows how it could be used, not how it should be used.
Do not use those examples in production without reviewing, understanding and configuring them.

Building your own images

You can build your own images easily using the docker build command in the root of this directory:

docker build . -f apache/Dockerfile -t mautic/mautic:5-apache
docker build . -f fpm/Dockerfile -t mautic/mautic:5-fpm

Persistent storage

The images by default foresee following volumes to persist data (not taking into account e.g. database or queueing data, as that's not part of these images).

Configuration and customizing

Configuration

The following environment variables can be used to configure how your setup should behave. There are 2 files where those settings can be set:

Those variables can also be set via the environment key on services defined in the docker-compose.yml file.

MySQL settings

PHP settings

Mautic behaviour settings

Mautic settings

Technically, every setting of Mautic you can set via the UI or via the local.php file can be set as environment variable.

e.g. the messenger_dsn_hit can be set via the MAUTIC_MESSENGER_DSN_HIT environment variable.
See the general Mautic documentation for more info.

Customization

Currently this image has no easy way to extend Mautic (e.g. adding extra composer dependencies or installing extra plugins or themes).
This is an ongoing effort we hope to support in an upcoming 5.x release.

For now, please build your own images based on the official ones to add the needed dependencies, plugins and themes.

Day to day tasks

Running console commands with Docker Compose

if you want to execute commands, you can make use of docker compose exec.

A full list of options for the command is available on the help pages.
The most important flags used in the examples below are:

Examples

Issues

If you have any problems with or questions about this image, please contact us through a GitHub issue.

You can also reach the Mautic community through its online forums or the Mautic Slack channel.

Contributing

You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

Before you start to code, we recommend discussing your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.