How to set configuration parameters

I created my own docker image which ´pulls’ from Tryton/Tryton image but I wanted to change some configuration parameters. Do I just have to create my own Tryton.conf file and COPY over the top of the Tryton image configuration file?

No. You should be able to override the file using docker configs or volumes and replacing this way the file the image expects in “/etc/trytond.conf”.

Otherwise you can also create your own specific volume and also override the TRYTOND_CONFIG variable.

Indeed there is a proposal to allow to modify any configuration default value by using environment variables.

This is specially usefull for the docker use case and prevents to create a custom image or use an specific volume for trytond.conf file

1 Like

Thanks @albert and @pokoli I was able to find my solution. I already have to extend the image as I am importing other modules, and so I was simply able to COPY then the file over from my repository to overwrite the existing trytond.conf file.

Indeed I think there are not one correct way.
But of course derived from the standard image just to change the configuration is not a very good solution because it requires to update the custom image each time the standard one is updated.
Override the trytond.conf could be a good solution if you already derive the standard image to add custom modules. But I would say that it makes sense only for configuration always needed and which has low chance to change overtime and which is not liked to the docker setup (like connection to the DB, hostname etc.)
For changing values, for now the best is to use, like @albert suggested, a volume and make trytond load it with -c option. I would not change the TRYTOND_CONFIG because it is good to keep /etc/trytond.conf loaded first.
Finally once issue7620 is implemented, it will be better to use it for all configuration that may change overtime (like limits, timeout etc.).

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.