diff --git a/.github/workflows/CD.yaml b/.github/workflows/CD.yaml index 3f6f582d..80098bfd 100644 --- a/.github/workflows/CD.yaml +++ b/.github/workflows/CD.yaml @@ -94,7 +94,7 @@ jobs: username: ${{ secrets.DEPLOY_USERNAME }} key: ${{ secrets.SSHKEY }} rm: true - source: docker-compose.yml, build/schema/initdb.sql, metrics/prometheus/prometheus.yml + source: docker-compose.yml, build/schema/initdb.sql, metrics/prometheus/prometheus.yml, metrics/grafana/grafana.ini target: ~/${{ env.FOLDER_COMPOSE }} - name: Get docker form dockerhub via SSH action diff --git a/docker-compose.yml b/docker-compose.yml index 2d58d6f1..b8e54d9f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -121,6 +121,7 @@ services: - type: bind source: /home/ubuntu/grafana_metrics target: /var/lib/grafana + - ./metrics/grafana/grafana.ini:/etc/grafana/grafana.ini networks: - hamster-net volumes: diff --git a/local-docker-compose.yaml b/local-docker-compose.yaml index a3f4fae5..d24a0bfc 100644 --- a/local-docker-compose.yaml +++ b/local-docker-compose.yaml @@ -27,36 +27,36 @@ services: ports: - "6379:6379" - # prometheus: - # container_name: prometheus - # image: prom/prometheus:latest - # volumes: - # - ./metrics/prometheus/prometheus.yaml:/etc/prometheus/prometheus.yml - # ports: - # - "9090:9090" + prometheus: + container_name: prometheus + image: prom/prometheus:latest + volumes: + - ./metrics/prometheus:/etc/prometheus + ports: + - "9090:9090" - # nodeexporter: - # container_name: node_exporter - # image: prom/node-exporter - # volumes: - # - /proc:/host/proc:ro - # - /sys:/host/sys:ro - # - /:/rootfs:ro - # restart: unless-stopped - # ports: - # - "9100:9100" + nodeexporter: + container_name: node_exporter + image: prom/node-exporter + volumes: + - /proc:/host/proc:ro + - /sys:/host/sys:ro + - /:/rootfs:ro + restart: unless-stopped + ports: + - "9100:9100" - # grafana: - # container_name: grafana - # image: grafana/grafana-oss:9.4.3 - # user: '0' - # ports: - # - "3000:3000" - # volumes: - # - type: bind - # source: /home/ubuntu/grafana_metrics - # target: /var/lib/grafana + grafana: + container_name: grafana + image: grafana/grafana-oss:9.4.3 + user: '0' + ports: + - "3000/metrics:3000" + volumes: + - type: bind + source: /home/ubuntu/grafana_metrics + target: /var/lib/grafana networks: diff --git a/metrics/prometheus/grafana/grafana.ini b/metrics/prometheus/grafana/grafana.ini new file mode 100644 index 00000000..293a9271 --- /dev/null +++ b/metrics/prometheus/grafana/grafana.ini @@ -0,0 +1,3 @@ +[server] +root_url = https://hammywallet.ru/grafana/ +serve_from_sub_path = true \ No newline at end of file