Using admin api, instead open port (#1)

* influxdb2 integration
* using python alpine base image
* add authorization, refactoring config
* logging instead print, keenetic api exception handling when try to collect metrics, a little pep8
This commit is contained in:
Sergei Samokhvalov
2021-03-24 13:44:34 +03:00
committed by GitHub
parent 7661b5819d
commit 16a37bf0d9
12 changed files with 196 additions and 97 deletions

View File

@@ -1,10 +1,11 @@
FROM python:3-slim
FROM python:3.8-alpine AS dependencies
COPY requirements.txt .
ADD keentic_influxdb_exporter.py /home
ADD requirements.txt /home
ADD value_normalizer.py /home
ADD influxdb_writter.py /home
ADD config/metrics.json /home/config/metrics.json
RUN pip install --no-cache-dir --user --no-warn-script-location -r requirements.txt
FROM python:3.8-alpine AS build-image
COPY --from=dependencies /root/.local /root/.local
COPY value_normalizer.py keentic_influxdb_exporter.py influxdb_writter.py keenetic_api.py /home/
RUN pip install -r /home/requirements.txt
CMD [ "python", "-u", "/home/keentic_influxdb_exporter.py" ]