dokku / dokku-mysql

a mysql plugin for dokku
MIT License
97 stars 39 forks source link

Keeping config changes between deploys #136

Closed ZeCarlosCoutinho closed 2 years ago

ZeCarlosCoutinho commented 2 years ago

Right now, I can create a new MySQL service with the config options that I want by adding the corresponding flags to the create command. However, if I have to redeploy the app, it seems that I have to remember to pass the same flags as before.

Is there any way of persisting these config changes between deploys?

josegonzalez commented 2 years ago

When you say redeploy, what do you mean? App deploys shouldn't change any env vars related to service configs.

ZeCarlosCoutinho commented 2 years ago

For example, a version update.

On my specific case, I want to set require_secure_transport=ON. As far as I understand, to start the MySQL service with this option on, I have to do something like this: dokku mysql:create -c require_secure_transport=ON

However, if in the future I decide to upgrade the mysql version, it seems I have to remember to provide these flags again. Or is there a way to set the require_secure_transport=ON on the env vars, which persists even after an update?

josegonzalez commented 2 years ago

Config options should be persisted to a file here. Are you running the latest version of the plugin?

ZeCarlosCoutinho commented 2 years ago

No (v.1.9.5), but I was just inferring this from reading the docs in the Github README.

I'm not very fluent in bash/sh, so I'm not completely sure about the meaning of the lines you sent. But I'm assuming the MySQL dokku service is already configured to read this file.

So, if I want to change the configurations after I have started the MySQL service, how can I do it? (supposedly, filesystem changes do not persist, so changing this config file should not be saved, right?)

josegonzalez commented 2 years ago

Please update, we handle this issue now.

We write the config outside of the docker container, and read the file when starting containers for the service. Filesystem changes within the container image on unmounted paths are not persisted (which is not the case here).