Skip to content

Commit

Permalink
añadida monitorización
Browse files Browse the repository at this point in the history
  • Loading branch information
fer4github committed Apr 29, 2024
1 parent 8668d3b commit 1ab77b0
Show file tree
Hide file tree
Showing 9 changed files with 1,718 additions and 8 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,44 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: questionservice
docker-push-grafana:
name: Push grafana service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# needs: [ e2e-tests ]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es05a/grafana
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: monitoring/grafana
env:
GF_SECURITY_ADMIN_USER: ${{ secrets.GF_SECURITY_ADMIN_USER }}
GF_SECURITY_ADMIN_PASSWORD: ${{ secrets.GF_SECURITY_ADMIN_PASSWORD }}
GF_SERVER_SERVE_FROM_SUB_PATH: false
docker-push-prometheus:
name: Push prometheus service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# needs: [ e2e-tests ]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es05a/prometheus
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: monitoring/prometheus
deploy:
name: Deploy over SSH
runs-on: ubuntu-latest
Expand All @@ -143,6 +181,8 @@ jobs:
- docker-push-gatewayservice
- docker-push-questionservice
- docker-push-webapp
- docker-push-grafana
- docker-push-prometheus
steps:
- name: Deploy over SSH
uses: fifsky/ssh-action@master
Expand Down
19 changes: 12 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,30 +82,35 @@ services:
- "3000:3000"

prometheus:
image: prom/prometheus
image: ghcr.io/arquisoft/wiq_5a/prometheus:latest
container_name: prometheus-${teamname:-wiq5a}
profiles: ["dev"]
build: ./monitoring/prometheus
profiles: ["dev", "prod"]
networks:
- mynetwork
volumes:
- prometheus_data:/prometheus
ports:
- "9090:9090"
depends_on:
- gatewayservice


grafana:
image: grafana/grafana
image: ghcr.io/arquisoft/wiq_5a/grafana:latest
container_name: grafana-${teamname:-wiq5a}
profiles: ["dev"]
build: ./monitoring/grafana
profiles: ["dev", "prod"]
networks:
- mynetwork
volumes:
- grafana_data:/var/lib/grafana
- ./gatewayservice/monitoring/grafana/provisioning:/etc/grafana/provisioning
environment:
- GF_SERVER_HTTP_PORT=9091
- GF_AUTH_DISABLE_LOGIN_FORM=true
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_SECURITY_ADMIN_USER=${GF_SECURITY_ADMIN_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD:-changeme}
- GF_SERVER_SERVE_FROM_SUB_PATH=${GF_SERVER_SERVE_FROM_SUB_PATH:-true}
ports:
- "9091:9091"
depends_on:
Expand Down
6 changes: 6 additions & 0 deletions monitoring/grafana/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM grafana/grafana

COPY provisioning/ /etc/grafana/provisioning/
COPY grafana.ini /etc/grafana/grafana.ini

CMD ["./bin/grafana"]
Loading

0 comments on commit 1ab77b0

Please sign in to comment.