Your software
My Mautic version is: 5.1.1
My PHP version is: 8.2
My Database type and version is: mysql 8
Your problem
I have seen many partial tutorials on how to run Mautic in Azure. None of them seem to result in a working implementation. They are either missing crucial details for what needs to happen before pushing to Azure or the Azure functionality used is not clearly stated.
I have done a lot of investigation to figure out what works and what doesn’t, and to understand why. I have come to a point where the problem is no longer Mautic or Azure, the problem is now me missing knowledge that I need to fix the this storage issue.
Everything I’m doing is going to be made public so hopefully other people can follow and use it, it is messy right now but I can make it all available (currently has some sensitive data that needs to be pulled out).
The part that I am struggling with could possibly be solved by another post here that mentioned using rsync when updating an install.
Here is my approach to run Mautic on Azure in a way that is scalable and secure while keeping it low cost and maintainable:
- Build docker images locally
- Push to Azure Container Registry
- Use Azure Storage to persist and share files as needed
- Use a Container Apps Environment to manage scaling and security
- Use a Container App Job to replace the Cron container
- Use a Container App running php-fpm as my backend
- Use a Container App running running supervisor as my worker
- Use a Container App running a custom Nginx image to handle ingress
- Use an Azure MySql resource to host the database
This looks like it will cost $25-$30 a month before any scaling
I am now working on mapping the storage correctly so that all the systems have access to the files they need while not creating a difficult/complex upgrade path for the future.
If anyone else is interested in implementing this, we should plan some time to have a working session to complete this.
Azure web apps will not work due to the features needed being in preview and do not have the needed functionality to work with storage containers.
I need to populate the smb file share docroot with the files in the backend container at /var/www/html/docroot
. I can’t mount there because it hides the existing files.
I don’t want to have a copy operation every time the container starts because I don’t want to waste the resources.
I tried creating a job to run manually to copy the files over by running cp -R -u -p /var/www/html/docroot /datastore
where /datastore
is the mountpoint but, nothing is being copied over and I am not sure why because I am not seeing any errors in the logs.
I also tried creating a /data
directory to copy it to during the container build. and then copy from /data
to /datastore
it copies to /data
but I still cant seem to get the files to move to the /datastore
mount.
Someone with Kubernetes experience would likely be able to fix this very quickly since that is the backend of the container environment.
If there is anything specific that I can provide to help fix this please let me know, I just didn’t want to dump all the files here and bloat this more.