-
Notifications
You must be signed in to change notification settings - Fork 259
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
Documentation on how this should be used with volumes #2
Comments
Sorry, been busy as of late, but trying to comment on some stuff. First, yes, the default for the image build is that the entire thing is stateless. Building it this way actually makes it usable as both a temporary testing box and a production system (with additional configuration). This is consistent with how the official Docker images for the CMS' (see WordPress and Drupal for example) are built too. The image here does make The environment variables are really meant for helping with the initial deployment and not for persisting the configuration values. Those variables, if set, are prefilled into a stub local.php configuration file so that when you run Mautic's installer on a new deployment then the database credentials are pre-filled (you'd just need to re-enter the password). There is also logic in place so that a new deployment doesn't overwrite the local.php file if it already exists which lets the configuration persist if you've attached everything to an external volume. I've done some testing of this image with this WordPress tutorial and the same concepts apply since the image was built pretty similarly to how that one is structured. So adding things into the documentation such as attaching an external volume should be relatively easy to accomplish (the README is basically a stub of what the official Docker library docs start off as). As for the environment variables, right now I don't think there is a need for more to be used when deploying an instance. As I hinted at above, they're really meant to help quick start the install process, but once you've got Mautic running in the container then you'd manage it pretty much the same way as you would if it were on a web hosting account. Obviously as things change within Mautic the image's configuration can be updated to support them. |
I see the logic now. Thanks. I'm not a fan of the way most people do their wordpress/drupal dockerfiles. I don't think the whole app should be located in a volume since 99% of it is just app code and doesn't change, except for updates (also, drupal should be installed with make files, but thats a diff topic). So I guess my suggestions above are only relevant if you don't use |
You could make an argument going both ways on the volume configuration. If you did volumes for only user content, in the case of Mautic we'd need volumes for the configuration, uploads, and plugins at a minimum (that's also assuming you're OK with stuff like the cache and logs not persisting, the latter might be questionable depending on what content is there). With the CMS' it just makes more sense in the long run to make the whole application a volume; with Mautic and the way it's structured it may be feasible to have separate volumes for those points that should persist since those directories are so few with our app structure. |
Yup. Thats what I was thinking. Plugins probably wouldn't need to persist either since they could be added by extending this dockerfile, or via env variable (like a link to the git repo, zip, etc...), or other method... Also, email themes would be the same way... |
+1 |
I totally agree with @that0n3guy. The way most Dockerfiles are made for Drupal/Wordpress is pretty bad and we should rather stick to the Docker best practices. local.php Cloud Storage Bundle And example in the Python world would be django-storages (http://django-storages.readthedocs.org/en/latest/) |
I know mautic has been updated a lot since this was created. Has anything changed in regards to this issue? |
Ideally I would like to bind mount one directory to store all the runtime settings.
Did I miss anything? |
If anyone is interested my Docker image is here https://github.com/mingfang/docker-mautic.git |
is there an easy way to move all user files to a specific directory so we dont have to mount /var/www/html? 200+Mb isnt a lot but it seems hackish to mount it |
@hanselke My version https://github.com/mingfang/docker-mautic.git does not volume mount the entire |
hi @mingfang thanks for the reply. Can i confirm that i just need to mount app/local as a volume? |
@hanselke Yes, please follow the instructions on my repo. |
@Gregy I see you just did some new docs in the readme. Still no mention of volumes (where are uploaded files stored, configs, etc...). Can you get those added? |
Hello, feel free to open a pull request with documentation changes. All help is welcome :) |
How to run this image as a stateless container? I can't figure out how to remove/recreate a container based on this image keeping the existing installation data. MySQL server and database database username and password are the same, through env variables, but everytime I recreate the container, it spins up the mautic installation again, and none of the changes made are reused on this new installation. Can someone help me? |
I think joaodalvi's issue is completely relevant to this issue. His question is exactly what this issue needs documented. |
Figured it out, after some good time. You have to create a volume for /var/www/html. This bit could be on the README, it would save people a LOT of time... |
@joaodalvi That's not really a solution either... that puts the whole mautic application in the volume. |
There are better images doing that - but running updates with By the way, this ticket is from 2015 - very long time.... |
Will this issue ever get attention? Does anyone have an alternative how to do it? I created a mautic-operator for kubernetes https://gitlab.com/ArjonBu/mautic-operator but the persistent storage is not yet taken care of. |
Yeah, this is still a problem. @mingfang has an old docker image (see this line on his dockerfile That would change the config paths to a single location so you could just mount that as a volume. I'm guessing (not tested) you could just mount the paths found here (https://github.com/mautic/mautic/blob/30909dcdc661951017917f402c96e80c219b7146/app/config/paths.php#L11) to volumes and it should work |
@luizeof has this issue had any progress recently? Perhaps we can get to sorting out how we should work with volumes and document it appropriately so we can close this 4+ years old issue down?! |
Hello @RCheesley, Mautic is a little different from most apps that have already been designed for this microservice reality. Volumes is the biggest example, by default, for a novice user (considering a novice who doesn't know how to handle docker volumes), by default, we use the entire / var / www / html folder. The whole application is there and it is much easier to change the image that only provides the environment (php, apache, etc.) and not the app itself. There are people who prefer to put only the main file which is /var/www/html/app/config/local.php on a volume. However, if you send files to Mautic through the editor, it is necessary to create a volume for / var / www / html / media /, if you use third party plugins it would be necessary to create a volume to persist / var / www / html / plugins and if you customize twig themes, you have the volume / var / www / html / themes. Therefore, since the beginning of the docker-mautic, a single volume has been created to deal with all these folders that need to be persistent as can be read here https://github.com/mautic/docker-mautic#persistent-data-volumes |
Mautic is more than 4 years old and only now it seems that we have a viable and modern documentation area. I believe it is possible to create a specific area for Docker there now. Ping me at Slack. |
Hello @luizeof, I would like just to share some thoughts I think it would be nice not to depend on volumes for non system wide config options. It would be more flexible if some configs (interface configs) were stored on db itself. |
Hello @petersondmg I believe this is related to Mautic itself and not to Mautic Docker. Mautic 3 has more features to make the container more effective. |
@luizeof this is a super old issue and as we have an initiative specifically around improving the install/upgrade process and documentation I have created an issue here: mautic/mautic-documentation#159 to track writing and improving resources relating to the Docker-based installations. Let's work on setting up some docs in the official documentation! |
We use docker for all our site deployments. We decided to not use any of these docker images but swiped some of the php scripts for setting up config files.
Some things I noticed that should be documented:
MAUTIC_DB_HOST
is kind of pointless because if you redeploy the container, your local.php will be lost and you have to "re-install" to get your secret_key again. If you put your local.php someplace in a docker volume, then you still don't need the mautic_db_hostmedia/files
should be linked to a docker volumelocal.php
should be linked to a docker volumeHow to make this stateless:
parameters_local.php
instead oflocal.php
(Separate secure config from non-secure config and support env variables in config mautic#886)local.php
someplace where it won't get wiped outThe text was updated successfully, but these errors were encountered: