Browse Source

implement configuration via envvars

fixes #1
master
lub 2 years ago
parent
commit
e285a7e96d
  1. 1
      Dockerfile
  2. 8
      src/metrics.php

1
Dockerfile

@ -9,6 +9,7 @@ RUN composer install
FROM docker.io/php:apache
EXPOSE 9367/tcp
ENV QUERY_HOST, QUERY_PORT, QUERY_USER_NAMe, QUERY_USER_PASSWORD_FILE
# copy apache configs
RUN rm /etc/apache2/sites-enabled/* \

8
src/metrics.php

@ -22,10 +22,10 @@ $up = $registry->getOrRegisterGauge(
$up->set(1, []);
$host = '192.168.178.55';
$port = 10011;
$user = rawurlencode('serveradmin');
$password = rawurlencode('4NReP1Wf');
$host = getenv('QUERY_HOST');
$port = getenv('QUERY_PORT');
$user = rawurlencode(getenv('QUERY_USER_NAME'));
$password = rawurlencode(trim(file_get_contents(getenv('QUERY_USER_PASSWORD_FILE'))));
$uri = 'serverquery://'.$user.':'.$password.'@'.$host.':'.$port.'/';

Loading…
Cancel
Save