Introducing our new CEO Don Johnson - Read More

elestio/mautic

Verified Publisher

By Elestio

Updated 2 days ago

Mautic, verified and packaged by Elestio

Image
API Management
Content Management System
5

4.2K

elest.io

DiscordElestio examplesBlog

Mautic, verified and packaged by Elestio

Mautic: Open Source Marketing Automation Software.

mautic

deploy

Deploy a fully managed Mautic on elest.io if you want automated backups, reverse proxy with SSL termination, firewall, automated OS & Software updates, and a team of Linux experts and open source enthusiasts to ensure your services are always safe, and functional.

Why use Elestio images?

  • Elestio stays in sync with updates from the original source and quickly releases new versions of this image through our automated processes.
  • Elestio images provide timely access to the most recent bug fixes and features.
  • Our team performs quality control checks to ensure the products we release meet our high standards.

Usage

Git clone

You can deploy it easily with the following command:

git clone https://github.com/elestio-examples/mautic.git

Copy the .env file from tests folder to the project directory

cp ./tests/.env ./.env

Edit the .env file with your own values.

Run the project with the following command ./scripts/preInstall.sh docker-compose up -d ./scripts/postInstall.sh

You can access the Web UI at: http://your-domain:7015

Docker-compose

Here are some example snippets to help you get started creating a container.

version: "3"

x-mautic-volumes: &mautic-volumes
- ./mautic/config:/var/www/html/config:z
- ./mautic/logs:/var/www/html/var/logs:z
- ./mautic/media/files:/var/www/html/docroot/media/files:z
- ./mautic/media/images:/var/www/html/docroot/media/images:z
- ./cron:/opt/mautic/cron:z
- mautic-docroot:/var/www/html/docroot:z

services:
db:
    image: elestio/mysql:8.0
    restart: always
    environment:
        - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
        - MYSQL_DATABASE=${MYSQL_DATABASE}
        - MYSQL_USER=${MYSQL_USER}
        - MYSQL_PASSWORD=${MYSQL_PASSWORD}
    volumes:
        - ./mysql-data:/var/lib/mysql
    healthcheck:
        test: mysqladmin --user=$$MYSQL_USER --password=$$MYSQL_PASSWORD ping
        start_period: 5s
        interval: 5s
        timeout: 5s
        retries: 10

nginx:
    image: nginx
    restart: always
    volumes:
        - ./nginx.conf:/etc/nginx/conf.d/default.conf
        - mautic-docroot:/var/www/html/docroot:z
    depends_on:
        - mautic_web
    ports:
        - 172.17.0.1:7015:80

mautic_web:
    image: elestio/mautic:${SOFTWARE_VERSION_TAG}
    restart: always
    links:
        - db:db
    volumes: *mautic-volumes
    environment:
        - DOCKER_MAUTIC_LOAD_TEST_DATA=${DOCKER_MAUTIC_LOAD_TEST_DATA}
        - DOCKER_MAUTIC_RUN_MIGRATIONS=${DOCKER_MAUTIC_RUN_MIGRATIONS}
        # - MAUTIC_MESSENGER_DSN_EMAIL=doctrine://default
        # - MAUTIC_MESSENGER_DSN_HIT=doctrine://default
    env_file:
        - .mautic_env
    healthcheck:
        test: cgi-fcgi -bind -connect 127.0.0.1:9000
        start_period: 5s
        interval: 5s
        timeout: 5s
        retries: 100
    depends_on:
        db:
            condition: service_healthy

mautic_cron:
    image: elestio/mautic:${SOFTWARE_VERSION_TAG}
    restart: always
    links:
        - db:db
    volumes: *mautic-volumes
    environment:
        - DOCKER_MAUTIC_ROLE=mautic_cron
    depends_on:
        mautic_web:
            condition: service_healthy

mautic_worker:
    image: elestio/mautic:${SOFTWARE_VERSION_TAG}
    restart: always
    links:
        - db:db
    volumes: *mautic-volumes
    environment:
        - DOCKER_MAUTIC_ROLE=mautic_worker
        - DOCKER_MAUTIC_LOAD_TEST_DATA=${DOCKER_MAUTIC_LOAD_TEST_DATA}
        - DOCKER_MAUTIC_RUN_MIGRATIONS=${DOCKER_MAUTIC_RUN_MIGRATIONS}
        # - MAUTIC_MESSENGER_DSN_EMAIL=doctrine://default
        # - MAUTIC_MESSENGER_DSN_HIT=doctrine://default
    depends_on:
        mautic_web:
            condition: service_healthy

volumes:
mautic-docroot:
    driver: local
    driver_opts:
    type: none
    device: ${PWD}/mautic-docroot
    o: bind
Environment variables
VariableValue (example)
SOFTWARE_VERSION_TAGlatest
ADMIN_EMAILyour@email.com
ADMIN_PASSWORDyour-password
MYSQL_ROOT_PASSWORDyour-password
MYSQL_PASSWORDyour-password
MYSQL_USERmautic_db_user
SMTPyour.smtp.host
SMTP_PORTyour.smtp.port
SMTP_FROMfrom@email.com
CI_CD_DOMAINyour.domain
MYSQL_HOSTdb
MYSQL_PORT3306
MYSQL_DATABASEmautic_db
DOCKER_MAUTIC_RUN_MIGRATIONSfalse
DOCKER_MAUTIC_LOAD_TEST_DATAfalse
MAUTIC_DB_HOSTdb
MAUTIC_DB_PORT3306
MAUTIC_DB_DATABASEmautic_db
MAUTIC_DB_USERmautic_db_user
MAUTIC_DB_PASSWORDyour-password
MAUTIC_MESSENGER_DSN_EMAILdoctrine://default
MAUTIC_MESSENGER_DSN_HITdoctrine://default
MAUTIC_URLhttps://your.domain
MAUTIC_ADMIN_EMAILyour@email.com
MAUTIC_ADMIN_USERNAMEadmin
MAUTIC_ADMIN_PASSWORDyour-password

Maintenance

Logging

The Elestio Mautic Docker image sends the container logs to stdout. To view the logs, you can use the following command:

docker-compose logs -f

To stop the stack you can use the following command:

docker-compose down

Backup and Restore with Docker Compose

To make backup and restore operations easier, we are using folder volume mounts. You can simply stop your stack with docker-compose down, then backup all the files and subfolders in the folder near the docker-compose.yml file.

Creating a ZIP Archive For example, if you want to create a ZIP archive, navigate to the folder where you have your docker-compose.yml file and use this command:

zip -r myarchive.zip .

Restoring from ZIP Archive To restore from a ZIP archive, unzip the archive into the original folder using the following command:

unzip myarchive.zip -d /path/to/original/folder

Starting Your Stack Once your backup is complete, you can start your stack again with the following command:

docker-compose up -d

That's it! With these simple steps, you can easily backup and restore your data volumes using Docker Compose.

Links

Docker Pull Command

docker pull elestio/mautic