{"id":13693111,"url":"https://github.com/mautic/docker-mautic","last_synced_at":"2025-04-07T05:07:00.373Z","repository":{"id":35516108,"uuid":"39786479","full_name":"mautic/docker-mautic","owner":"mautic","description":"Docker Image for Mautic","archived":false,"fork":false,"pushed_at":"2024-09-18T16:49:33.000Z","size":288,"stargazers_count":376,"open_issues_count":95,"forks_count":280,"subscribers_count":39,"default_branch":"mautic5","last_synced_at":"2024-10-29T18:48:31.584Z","etag":null,"topics":["docker-image","mautic"],"latest_commit_sha":null,"homepage":"https://www.mautic.org","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mautic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-27T16:56:23.000Z","updated_at":"2024-10-25T18:44:28.000Z","dependencies_parsed_at":"2023-01-15T22:34:43.621Z","dependency_job_id":"435dacd4-da7a-44b1-a3a2-771d9cf6984e","html_url":"https://github.com/mautic/docker-mautic","commit_stats":{"total_commits":242,"total_committers":25,"mean_commits":9.68,"dds":0.5991735537190083,"last_synced_commit":"084bcee5cc963379a8c519fe2fad4df8eeb37615"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mautic%2Fdocker-mautic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mautic%2Fdocker-mautic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mautic%2Fdocker-mautic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mautic%2Fdocker-mautic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mautic","download_url":"https://codeload.github.com/mautic/docker-mautic/tar.gz/refs/heads/mautic5","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174415,"owners_count":20896078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-image","mautic"],"created_at":"2024-08-02T17:01:05.732Z","updated_at":"2025-04-07T05:07:00.333Z","avatar_url":"https://github.com/mautic.png","language":"Dockerfile","funding_links":[],"categories":["Official Repositories"],"sub_categories":[],"readme":"# Mautic Docker image and examples\n\n\u003e [!NOTE]\n\u003e _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._\n\n## Versions\n\nall Mautic 5 Docker images follow the following naming stategy.\n\n`\u003cmajor.minor.patch\u003e-\u003cvariant\u003e`\n\nThere are some defaults if parts are omitted:\n\n* `\u003cminor.patch\u003e` is the latest release patch version in the latest minor version.\n\nsome examples:\n\n* `5-apache`: latest stable version of Mautic 5 of the `apache` variant\n* `5.0-fpm`: latest version in the 5.0 minor release in the `fpm` variant \n* `5.0.3-apache`: specific point release of the `apache` variant\n\n## Variants\n\nThe Docker images exist in 2 variants:\n\n* `apache`: image based on the official `php:apache` images.\n* `fpm`: image based on the official `php:fpm` images.\n\nThe latest supported Mautic PHP version is used the moment of generating of the image.\n\nEach variant contains:\n\n* the needed dependencies to run Mautic (e.g. PHP modules)\n* the Mautic codebase installed via composer (see mautic/recommended-project)\n* the needed files and configuration to run as a specific role\n\nSee the `examples` explanation below how you could use them.\n\n## Roles\n\neach image can be started in 3 modes:\n\n* `mautic_web`: runs the Mautic webinterface\n* `mautic_worker`: runs the worker processes to consume the messenger queues \n* `mautic_cron`: runs the defined cronjobs\n\nThis allows you to use different scaling strategies to run the workers or crons, without having to maintain separate images.  \nThe `mautic_cron` and `mautic_worker` require the codebase anyhow, as they execute console commands that need to bootstrap the full application.\n\n## Examples\n\nThe `examples` folder contains examples of `docker-compose` setups that use the Docker images.  \n\n\u003e [!WARNING]\n\u003e The examples **require `docker compose` v2**.  \n\u003e Running the examples with the unsupported `docker-compose` v1 will result in a non-starting web container.  \n\n\u003e [!IMPORTANT]\n\u003e Please take into account the purpose of those examples:  \n\u003e it shows how it **could** be used, not how it **should** be used.  \n\u003e Do not use those examples in production without reviewing, understanding and configuring them.\n\n* `basic`: standard example using the `apache` image with `doctrine` as async queue.\n* `fpm-nginx`: example using the `fpm` image in combination with an `nginx` with `doctrine` as async queue.\n* `rabbitmq-worker`: example using the `apache` image with `rabbitmq` as async queue.\n\n## Building your own images\n\nYou can build your own images easily using the `docker build` command in the root of this directory:\n\n```\ndocker build . -f apache/Dockerfile -t mautic/mautic:5-apache\ndocker build . -f fpm/Dockerfile -t mautic/mautic:5-fpm\n```\n\n## Persistent storage\n\nThe 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).\n\n * `config`: the local config folder containing `local.php`, `parameters_local.php`, ...\n * `var/logs`: the folder with logs\n * `docroot/media`: the folder with uploaded and generated media files\n\n## Configuration and customizing\n\n### Configuration\n\nThe following environment variables can be used to configure how your setup should behave.\nThere are 2 files where those settings can be set:\n\n* the `.env` file: \n  Should be used for all general variables for Mysql, PHP, ...\n* the `.mautic_env` file:\n  Should be used for all Mautic specific variables.\n\nThose variables can also be set via the `environment` key on services defined in the `docker-compose.yml` file.\n\n#### MySQL settings\n - `MYSQL_HOST`: the MySQL host to connect to\n - `MYSQL_PORT`: the MySQL port to use\n - `MYSQL_DATABASE`: the database name to be used by Mautic\n - `MYSQL_USER`: the MySQL user that has access to the database\n - `MYSQL_PASSWORD`: the password for the MySQL user \n - `MYSQL_ROOT_PASSWORD`: the password for the MySQL root user that is able to configure the above users and database\n\n#### PHP settings\n\n - `PHP_INI_VALUE_DATE_TIMEZONE`: defaults to `UTC`\n - `PHP_INI_VALUE_MEMORY_LIMIT`: defaults to `512M`\n - `PHP_INI_VALUE_UPLOAD_MAX_FILESIZE`: defaults to `512M`\n - `PHP_INI_VALUE_POST_MAX_FILESIZE`: defaults to `512M`\n - `PHP_INI_VALUE_MAX_EXECUTION_TIME`: defaults to `300`\n\n#### Mautic behaviour settings\n\n - `DOCKER_MAUTIC_ROLE`: which role does the container has to perform.  \n   Defaults to `mautic_web`, other supported values are `mautic_worker` and `mautic_cron`.\n - `DOCKER_MAUTIC_LOAD_TEST_DATA`: should the test data be loaded on start or not.  \n   Defaults to `false`, other supported value is `true`.  \n   This variable is only usable when using the `web` role.\n - `DOCKER_MAUTIC_RUN_MIGRATIONS`: should the Doctrine migrations be executed on start.  \n   Defaults to `false`, other supported value is `true`.  \n   This variable is only usable when using the `web` role.\n - `DOCKER_MAUTIC_WORKERS_CONSUME_EMAIL`: Number of workers to start consuming mails.  \n   Defaults to `2`\n - `DOCKER_MAUTIC_WORKERS_CONSUME_HIT`: Number of workers to start consuming hits.  \n   Defaults to `2`\n - `DOCKER_MAUTIC_WORKERS_CONSUME_FAILED`: Number of workers to start consuming failed e-mails.  \n   Defaults to `2`\n\n#### Mautic settings\n\nTechnically, every setting of Mautic you can set via the UI or via the `local.php` file can be set as environment variable.\n\ne.g. the `messenger_dsn_hit` can be set via the `MAUTIC_MESSENGER_DSN_HIT` environment variable.  \nSee the general Mautic documentation for more info.\n\n### Customization\n\nCurrently this image has no easy way to extend Mautic (e.g. adding extra `composer` dependencies or installing extra plugins or themes).  \nThis is an ongoing effort we hope to support in an upcoming 5.x release.  \n  \n\nFor now, please build your own images based on the official ones to add the needed dependencies, plugins and themes.\n\n## Day to day tasks\n\n### Running console commands with Docker Compose\n\nif you want to execute commands, you can make use of `docker compose exec`.\n\nA full list of options for the command is available [on the help pages](https://docs.docker.com/engine/reference/commandline/compose_exec/).  \nThe most important flags used in the examples below are:\n\n* `-u www-data`: execute as the `www-data` user, which is the same user as the webserver runs. This ensures that e.g. file permissions after clearing the cache are correct.\n* `-w /var/www/html`: set the working directory to the `/var/www/html` folder, which is the project root of Mautic.\n\n**Examples** \n\n* Open a shell in the running `mautic_web` container:\n\n    ```\n    docker compose exec -u www-data -w /var/www/html mautic_web /bin/bash\n    ```\n\n* execute a command in the running `mautic_web` container and return the output directly\n    ```\n    docker compose exec -u www-data -w /var/www/html mautic_web php ./bin/console\n    ```\n\n## Issues\n\nIf you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/mautic/docker-mautic/issues).\n\nYou can also reach the Mautic community through its [online forums](https://www.mautic.org/community/) or the [Mautic Slack channel](https://www.mautic.org/slack/).\n\n## Contributing\n\nYou 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.\n\nBefore you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/mautic/docker-mautic/issues), 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmautic%2Fdocker-mautic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmautic%2Fdocker-mautic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmautic%2Fdocker-mautic/lists"}