commit 258741d6906ea5ff0212fd9f3b245f50bec7e709 Author: m3tam3re Date: Wed Feb 28 19:29:49 2024 +0100 first commit diff --git a/.env b/.env new file mode 100644 index 0000000..2f05cc5 --- /dev/null +++ b/.env @@ -0,0 +1,10 @@ +COMPOSE_PROJECT_NAME=basic +COMPOSE_NETWORK=${COMPOSE_PROJECT_NAME}-docker +MYSQL_HOST=db.${COMPOSE_NETWORK} +MYSQL_PORT=3306 +MYSQL_DATABASE=mautic_db +MYSQL_USER=mautic_db_user +MYSQL_PASSWORD=mautic_db_pwd +MYSQL_ROOT_PASSWORD=changeme +DOCKER_MAUTIC_RUN_MIGRATIONS=false +DOCKER_MAUTIC_LOAD_TEST_DATA=false diff --git a/.mautic_env b/.mautic_env new file mode 100644 index 0000000..3c29a70 --- /dev/null +++ b/.mautic_env @@ -0,0 +1,11 @@ +# use this file for environment variables that can be used. +# see https://docs.mautic.org/en/5.x/ + +MAUTIC_DB_HOST="${MYSQL_HOST}" +MAUTIC_DB_PORT="${MYSQL_PORT}" +MAUTIC_DB_DATABASE="${MYSQL_DATABASE}" +MAUTIC_DB_USER="${MYSQL_USER}" +MAUTIC_DB_PASSWORD="${MYSQL_PASSWORD}" + +MAUTIC_MESSENGER_DSN_EMAIL="doctrine://default" +MAUTIC_MESSENGER_DSN_HIT="doctrine://default" diff --git a/README.org b/README.org new file mode 100644 index 0000000..39023d7 --- /dev/null +++ b/README.org @@ -0,0 +1,16 @@ +This repo is just a quick edit of the basic docker template from the official docker-mautic repo. + +Please check https://github.com/mautic/docker-mautic for more information and documentation + +* Installation + +This repo is an example on how to install mautic v5 with portainer. + +1. Create a new stack in Portainer +2. Choose *Upload* and upload *docker-compose.yml* from this repo +3. Upload *.env* and *.mautic_env* with *Load variables from .env file* +4. Change the environment variables where necessary +5. Deploy the stack +6. IMPORTANT: When doing a fresh install stop *mautic_cron* and *mautic_worker* otherwise the installtion will fail with a SQL error +7. Start *mautic_cron* and *mautic_worker* again after successfull installation +8. Have Fun 🙂 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a015754 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,90 @@ +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 + +services: + db: + image: mysql:8.0 + 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 + networks: + - default + + mautic_web: + image: mautic/mautic:5-apache + links: + - db:mysql + ports: + - 8001:80 + volumes: *mautic-volumes + + environment: + - DOCKER_MAUTIC_LOAD_TEST_DATA=${DOCKER_MAUTIC_LOAD_TEST_DATA} + - DOCKER_MAUTIC_RUN_MIGRATIONS=${DOCKER_MAUTIC_RUN_MIGRATIONS} + env_file: + - stack.env + healthcheck: + test: curl http://localhost + start_period: 5s + interval: 5s + timeout: 5s + retries: 100 + depends_on: + db: + condition: service_healthy + networks: + - default + + mautic_cron: + image: mautic/mautic:5-apache + links: + - db:mysql + volumes: *mautic-volumes + environment: + - DOCKER_MAUTIC_ROLE=mautic_cron + env_file: + - stack.env + depends_on: + mautic_web: + condition: service_healthy + networks: + - default + + mautic_worker: + image: mautic/mautic:5-apache + links: + - db:mysql + volumes: *mautic-volumes + environment: + - DOCKER_MAUTIC_ROLE=mautic_worker + env_file: + - stack.env + depends_on: + mautic_web: + condition: service_healthy + networks: + - default + +volumes: + mysql-data: + +networks: + default: + name: ${COMPOSE_PROJECT_NAME}-docker