diff --git a/common/docker_dockerstats/tasks/main.yml b/common/docker_dockerstats/tasks/main.yml index dbc65c107c09833b40658d6a8361e05d8809c517..185470023d9e194e345d7af7d6ac2396927b947b 100644 --- a/common/docker_dockerstats/tasks/main.yml +++ b/common/docker_dockerstats/tasks/main.yml @@ -14,7 +14,6 @@ src: "{{ item }}" dest: "{{ basedir }}/{{ item }}" with_items: - - Dockerfile - docker-compose.yml diff --git a/common/docker_dockerstats/templates/Dockerfile b/common/docker_dockerstats/templates/Dockerfile deleted file mode 100644 index 793b7781f16e3c35b0213babc1185e883d014aba..0000000000000000000000000000000000000000 --- a/common/docker_dockerstats/templates/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM node:21-alpine - -RUN apk update \ - && apk upgrade \ - && apk add --no-cache git - -RUN mkdir -p /usr/src/app \ - && cd /usr/src/app \ - && git clone https://github.com/elberfeld/docker_stats_exporter.git \ - && cd /usr/src/app/docker_stats_exporter \ - && git checkout 2020.07.30.1 \ - && npm install - -WORKDIR /usr/src/app/docker_stats_exporter - -EXPOSE 9487 -ENV DOCKERSTATS_PORT=9487 DOCKERSTATS_INTERVAL=15 DEBUG=0 - -ENTRYPOINT [ "npm", "start" ] diff --git a/common/docker_dockerstats/templates/docker-compose.yml b/common/docker_dockerstats/templates/docker-compose.yml index d126e20ba93ed2bc8a04ee1a23bb73c5a2ab8504..cac9149112f318b954b4803aa7b9dbb17b8c6d96 100644 --- a/common/docker_dockerstats/templates/docker-compose.yml +++ b/common/docker_dockerstats/templates/docker-compose.yml @@ -4,12 +4,14 @@ services: app: - build: . + image: wywywywy/docker_stats_exporter restart: always ports: - - "{{ int_ip4 }}:9487:9487" + - "{{ int_ip4 }}:{{ metrics_port }}:{{ metrics_port }}" volumes: - /var/run/docker.sock:/var/run/docker.sock - /usr/bin/docker:/usr/bin/docker - labels: - - com.centurylinklabs.watchtower.enable=false + environment: + DOCKERSTATS_PORT: {{ metrics_port }} + DOCKERSTATS_INTERVAL: 15 + DEBUG: 0 diff --git a/site.yml b/site.yml index e2cec181db15b34eac297493dd25dafbcbdb492f..7c50784ead8507dbd2241319572f01a02a2539d0 100644 --- a/site.yml +++ b/site.yml @@ -99,7 +99,8 @@ - { role: common/docker_dockerstats, tags: dockerstats, servicename: dockerstats, - basedir: /srv/dockerstats + basedir: /srv/dockerstats, + metrics_port: 9487 } - { role: common/docker_traefik, tags: traefik, @@ -193,7 +194,8 @@ - { role: common/docker_dockerstats, tags: dockerstats, servicename: dockerstats, - basedir: /srv/dockerstats + basedir: /srv/dockerstats, + metrics_port: 9487 } - { role: common/docker_ldap, tags: ldap, @@ -310,7 +312,8 @@ - { role: common/docker_dockerstats, tags: dockerstats, servicename: dockerstats, - basedir: /srv/dockerstats + basedir: /srv/dockerstats, + metrics_port: 9487 } - { role: common/docker_traefik, tags: traefik, @@ -380,7 +383,8 @@ - { role: common/docker_dockerstats, tags: dockerstats, servicename: dockerstats, - basedir: /srv/dockerstats + basedir: /srv/dockerstats, + metrics_port: 9487 } - { role: common/docker_traefik, tags: traefik,