Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Arquisoft/wiq_es05a
Browse files Browse the repository at this point in the history
  • Loading branch information
uo276026 committed Apr 30, 2024
2 parents e43d0ad + 7e04705 commit f3dc322
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 29 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ on:
branches:
- master
- develop
- newDevelop
- LaraFMz
- Pablo-Arreglos
- Pablo-AjustesFinales
- jota
pull_request:
types: [opened, synchronize, reopened]
Expand Down
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
46 changes: 25 additions & 21 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
mongodb:
container_name: mongodb-${teamname:-wiq5a}
container_name: mongodb-${teamname:-wiq_es05a}
image: mongo
profiles: ["dev", "prod"]
volumes:
Expand All @@ -12,8 +12,8 @@ services:
- mynetwork

questionservice:
container_name: questionservice-${teamname:-wiq5a}
image: ghcr.io/arquisoft/wiq_5a/questionservice:latest
container_name: questionservice-${teamname:-wiq_es05a}
image: ghcr.io/arquisoft/wiq_es05a/questionservice:latest
profiles: ["dev", "prod"]
build: ./questionservice
ports:
Expand All @@ -25,8 +25,8 @@ services:
- mynetwork

authservice:
container_name: authservice-${teamname:-wiq5a}
image: ghcr.io/arquisoft/wiq_5a/authservice:latest
container_name: authservice-${teamname:-wiq_es05a}
image: ghcr.io/arquisoft/wiq_es05a/authservice:latest
profiles: ["dev", "prod"]
build: ./userservice/authservice
depends_on:
Expand All @@ -39,8 +39,8 @@ services:
MONGODB_URI: mongodb://mongodb:27017/userdb

userservice:
container_name: userservice-${teamname:-wiq5a}
image: ghcr.io/arquisoft/wiq_5a/userservice:latest
container_name: userservice-${teamname:-wiq_es05a}
image: ghcr.io/arquisoft/wiq_es05a/userservice:latest
profiles: ["dev", "prod"]
build: ./userservice/userservice
depends_on:
Expand All @@ -53,8 +53,8 @@ services:
MONGODB_URI: mongodb://mongodb:27017/userdb

gatewayservice:
container_name: gatewayservice-${teamname:-wiq5a}
image: ghcr.io/arquisoft/wiq_5a/gatewayservice:latest
container_name: gatewayservice-${teamname:-wiq_es05a}
image: ghcr.io/arquisoft/wiq_es05a/gatewayservice:latest
profiles: ["dev", "prod"]
build: ./gatewayservice
depends_on:
Expand All @@ -72,8 +72,8 @@ services:
QUESTION_SERVICE_URL: http://questionservice:8003

webapp:
container_name: webapp-${teamname:-wiq5a}
image: ghcr.io/arquisoft/wiq_5a/webapp:latest
container_name: webapp-${teamname:-wiq_es05a}
image: ghcr.io/arquisoft/wiq_es05a/webapp:latest
profiles: ["dev", "prod"]
build: ./webapp
depends_on:
Expand All @@ -82,30 +82,34 @@ services:
- "3000:3000"

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


grafana:
image: grafana/grafana
container_name: grafana-${teamname:-wiq5a}
profiles: ["dev"]
image: ghcr.io/arquisoft/wiq_es05a/grafana:latest
container_name: grafana-${teamname:-wiq_es05a}
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: 0 additions & 6 deletions gatewayservice/monitoring/prometheus/prometheus.yml

This file was deleted.

5 changes: 5 additions & 0 deletions monitoring/grafana/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM grafana/grafana

COPY provisioning/ /etc/grafana/provisioning/

CMD ["./bin/grafana"]
Original file line number Diff line number Diff line change
Expand Up @@ -372,4 +372,4 @@
"title": "Example Service Dashboard",
"uid": "1DYaynomMk",
"version": 2
}
}
5 changes: 5 additions & 0 deletions monitoring/prometheus/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM prom/prometheus

COPY prometheus.yml .

ENTRYPOINT ["/bin/prometheus"]
6 changes: 6 additions & 0 deletions monitoring/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
global:
scrape_interval: 15s
scrape_configs:
- job_name: "example-nodejs-app"
static_configs:
- targets: ["gatewayservice-wiq_es05a:8000","userservice-wiq_es05a:8001","authservice-wiq_es05a:8002","questionservice-wiq_es05a:8003"]

0 comments on commit f3dc322

Please sign in to comment.