From 2782c4962c14517930845defc818c5faee085305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= Date: Thu, 27 Jul 2023 17:15:33 +0000 Subject: [PATCH] Fix Dockerfile --- Dockerfile | 8 +++++--- app.py | 7 +------ requirements.txt | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3f8d13e..b90a402 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ FROM python:3.11-bookworm -RUN pip install -r requirements.txt -COPY app.py /app.py -ENTRYPOINT python /app.py \ No newline at end of file +WORKDIR /app +COPY requirements.txt /app/requirements.txt +RUN pip install -r /app/requirements.txt +COPY app.py /app/app.py +ENTRYPOINT python /app/app.py diff --git a/app.py b/app.py index 56d6b1d..208b28b 100644 --- a/app.py +++ b/app.py @@ -21,12 +21,7 @@ class ContainerCollector(object): f"Docker container stats network.{key}", labels=["container", "device"], ) - # "created", "running", "paused", "restarting", "removing", "exited", "dead" - # node_network_receive_packets_total - # node_network_speed_bytes - # node_network_transmit_bytes_total - # node_network_transmit_dropped_total - # node_network_transmit_errors_total + m_container_status = InfoMetricFamily("docker_container_info", "Container info.", labels=["container"]) for container in self.docker_client.containers(all=True): diff --git a/requirements.txt b/requirements.txt index 4ad64d3..2a4b295 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ docker-py == 1.10.6 prometheus-client == 0.17.1 -urllib3 >= 1.26.0, < 2.0.0 \ No newline at end of file +urllib3 >= 1.26.0, < 2.0.0