MarvAmBass / docker-piwik

⚠️ DEPRECATED ::: A Docker Piwik Container
MIT License
29 stars 26 forks source link

Docker: add your own config.ini.php #13

Open gregbkr opened 9 years ago

gregbkr commented 9 years ago

Good evening Piwik team!

Quick docker related question: How do you load your own /piwik/config/config.ini.php file? Mapping this file in piwik container run (-v $PWD/config.ini.php:/piwik/config/config.ini.php) makes piwik config fail.

Seems like I can only map it after piwik finished its initialization, doing a simple copy, which add some step. docker cp $PWD/config.ini.php piwik:/piwik/config/config.ini.php

Is there another cleaner solution or I missed something? I don't wish to create/manage my own container with this only addition.

Thanks a lot for your help. And very good week! ;-)

Greg.

MarvAmBass commented 9 years ago

hey greg,

well there are some mindfucks here :smile:

in the build process my predefined config is installed to piwik. But! if you start the container, and the initial setups runs through it, this predefined config is replaced by the one generated by the installer.

so basically my predefined config is never used.

the reason piwik keeps failing after you mount the config from outside the container is, that the piwik startup script is no longer able to replace the file with the generated config.

you chould check my startup piwik script, I currently don't have much time to enhance it to support custom configs. And also I don't see the reason to use a custom config, if the container does everything necessary to create a config automatically. (okay if you need to enable some special features you're right - it's usefull to add special options to the config)

the best but also the hardest reason would be to merge the custom configuration with the generated one. after generation but before piwik boots up.

OR

you search for something like a /piwik/config/custom-config.ini.php.partial and add it's contents to the original generated /piwik/config/config.ini.php shortly before piwik startup. that would be the easiest and practical solution