Closed AgentSixty6 closed 6 years ago
I think it is quite reasonable to provide some defaults. As it makes setting up container much easier for novices and you can always provide actual port (if you "mapped it to any port") via variable, overriding default provided.
Also, if you look at the documentation, it is documented already, how to provide remote DB host.
I guess you could make the same argument for variables such as TZ, DISABLE_IPV6, POLLERS, ...
However, sensible defaults make things a lot easier for the vast majority of users. In my opinion, there should be as few required variables as possible, which is achieved by relying on convention (rather than configuration).
Since you deviate from well established standards (port 3306 is officially registered to MySQL with the IANA) you should have known that the nonstandard port must be present somewhere in your configuration for things to work.
@jarischaefer
Since you deviate from well established standards (port 3306 is officially registered to MySQL with the IANA) you should have known that the nonstandard port must be present somewhere in your configuration for things to work.
While I agree with that there are well established standards, in many environments where many of the same services exist (i.e. kubernetes), it can be challenging to enable use of the same port for the same app/service types.
My comment was that this should be a much easier process to override vs having to manually edit a config in the container or via volume static file. For example: passing a DB_Port variable allows override of default to your liking, not specifying the variable defaults to 3306.
Perhaps my interpretation is inaccurate, but I assume you edited the file inside the container or mounted a static file to modify the port and you are suggesting we introduce an environment variable to simplify the process?
The MYSQL port should not be assumed as it can mapped to any port.
Would you be willing to support another environment variable for DB PORT or remove the static defined and update the documentation to include the host address and port.
https://github.com/jarischaefer/docker-librenms/blob/fbb0139ce2d52ebf51949341fada9eb95ef5d0c7/files/opt/librenms/config.php#L4