-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mautic 4 stateless container #198
base: mautic4
Are you sure you want to change the base?
Conversation
Tried this but installation was not successful. I have not filled env vars MAUTIC_URL, MAUTIC_ADMIN_EMAIL, MAUTIC_ADMIN_PASSWORD because it is not mentioned in README. When run it behaves like I filled them:
|
For anyone who wants to test it, I published this build here: https://hub.docker.com/r/bobik/mautic (v4-apache) |
When I filled variables it installed. Btw, installation should work also without HTTPS because it ofter takes time before Let's Encrypt creates certificate. |
There are "PHP options" twice in the README. |
260026e
to
bb792ba
Compare
An effort has been made in the past to combine any dockerfiles into a central location, but wasn't finalized (i assume due to docker not allowing includes from directories higher up). This completes this work, and documents how to run the Dockerfiles to produce working containers.
This changes the environment variable config so that any environment variable changes are re-applied to local.php on container startup. It is part of some work I am doing to help make the mautic containers more devops friendly.
This commit will automatically perform a command line installation on first start, assuming mautic hasn't already been installed. You need to supply MAUTIC_URL, MAUTIC_ADMIN_EMAIL and MAUTIC_ADMIN_PASSWORD, or these will default to localhost, [email protected] and password. If you are installing on a non-https host, or have another reason why the install might need to be forced, you can set the `MAUTIC_INSTALL_FORCE` environment variable to force this install.
clear cache, apply migrations and grab iplookup database on startup
We currently apply all migrations at startup - this is not needed for some users who are only running small parts of mautic. Add an environment variable that can be set to disable this behaviour.
This update makes a few changes: - Moves `local.php`, `cache`, `logs`, `media` and `spool` into a volume at `/data` - Makes sure the above exist and are owned by www-data on startup - Drops mautic into /var/www/html and removes the copy on initial bringup
bb792ba
to
e1ecffd
Compare
I'm now happy this is working - i've been running a slightly tweaked version of it (built using gitlab CI) for around month. Thanks for the review @iBobik:
|
Added a commit that clears the cache fully on container startup, as mautic's built in cache clear was missing files and causing failures on upgrade from 4.0.0-beta to 4.0.0-rc |
@thinkl33t |
@iBobik I just tested your image which works well on my side. There is just the MAUTIC_VERSION env variable in docker-compose that doesn't seem to be taken into account because when I change it to MAUTIC_VERSION=4.0.0 it installs version 4.0.0-rc The only thing missing would be the possibility to run Mautic with a slave mysql database in locked state to be able to do failover and high availability on a cluster, currently I get an error message when I run mautic on lock tables. |
Hello, I will not continue on this for now, because my project was cancelled, so I will not test it.
Honza Pobořil
… 22. 9. 2021 v 20:05, user592965 ***@***.***>:
@iBobik I just tested your image which works well on my side. There is just the MAUTIC_VERSION variable that doesn't seem to be taken into account because when I change it to MAUTIC_VERSION=4.0.0 it installs version 4.0.0-rc
The only thing missing would be the possibility to run Mautic with a slave mysql database in locked state to be able to do failover and high availability on a cluster, currently I get an error message when I run mautic on lock tables.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Any news on getting this merged? In my tests it worked fine? Codebase divergence is a thing though |
Pretty useful changes, as it looks like. The addressed issues are a main issue currently when deciding to go docker with Mautic or not. |
@iBobik Could you elaborate on which tasks need to be done? |
Check by fork I deployed into production: https://github.com/ibobik/docker-mautic I have not tested it extensively, so not sure if everything works, but it seemed ok. |
thanks @iBobik ... I will check this pull this week ... many thanks. |
any news about this? |
fi | ||
|
||
# clear mautic cache | ||
rm -rf /data/cache/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a couple of problems here:
-
It deletes the Maxmind's IP database on startup (/data/cache/ip_data)
It would be better to to keep the IP database between restarts (for my use case) -
I can't even mount a volume for the IP database (/data/cache/ip_data)
The container fails to start with the following error message:rm: cannot remove '/data/cache/ip_data': Device or resource busy
if I mount a volume to persist the ip database -
I can't mount any volumes inside /data/cache/ otherwise the container will not start with the same error above.
By the commit logs I think @thinkl33t run into cache problems when doing version upgrades
Possible solutions:
Delete only /data/cache/prod either running rm -rf /data/cache/prod/*
or php bin/console cache:clear
Other possible solution would be to add an environment variable (MAUTIC_CLEAR_CACHE) and only clear the cache if it is true.
Thanks for the review and testing @ivanmonteiro - much appreciated! @thinkl33t @wget @luizeof could you take a look at the feedback and decide where we want to go with this feature? |
@RCheesley I'm currently working on it. valeu @ivanmonteiro ... muito bom ter brasileiros por aqui! |
Apart from the cache delete problem I commented above, I really liked the lean folder structure. With only a couple of folders and configuration files instead of the whole mautic code. @luizeof Se precisar de ajuda para testar me avisa e farei o possível para ajuda-lo |
Hi guys just checking if this is moving forward and If something else needs to be done (maybe I can help) |
This update makes a few changes:
local.php
,cache
,logs
,media
andspool
into a volumeat
/data
bringup
Should close at least #2, #90, #184, #203