Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitoring/graphana prometheus docker fixes #252

Merged
merged 4 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,32 @@ jobs:
DATABASE_PASSWORD
JWT_SECRET
SSL_PASSWORD
docker-push-prometheus:
runs-on: ubuntu-latest
needs: [ e2e-tests ]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_en2b/prometheus
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: api/monitoring/prometheus
docker-push-grafana:
runs-on: ubuntu-latest
needs: [ e2e-tests ]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_en2b/grafana
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: api/monitoring/grafana
docker-push-kiwiq:
runs-on: ubuntu-latest
needs: [ e2e-tests ]
Expand Down
14 changes: 14 additions & 0 deletions api/monitoring/grafana/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM grafana/grafana
LABEL authors="dario"
# Define the source and destination directories
COPY_SOURCE = ./provisioning
COPY_DESTINATION = /etc/grafana/provisioning

# Copy the configuration files
COPY ${COPY_SOURCE}/* ${COPY_DESTINATION}

# Expose the default Grafana port
EXPOSE 9091

# Run Grafana in the foreground
CMD ["grafana-server"]
14 changes: 14 additions & 0 deletions api/monitoring/prometheus/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM prom/prometheus
LABEL authors="dario"
# Define the source and destination directories
COPY_SOURCE = ./configuration
COPY_DESTINATION = /etc/prometheus

# Copy the configuration files
COPY ${COPY_SOURCE}/* ${COPY_DESTINATION}

# Expose the default Prometheus port
EXPOSE 9090

# Run Prometheus in the foreground
CMD ["prometheus"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ scrape_configs:
metrics_path: '/actuator/prometheus'
scrape_interval: 10s
static_configs:
- targets: ['host.docker.internal:8080']
- targets: ['host.docker.internal:8443']
labels:
application: 'WIQ API'
33 changes: 18 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,6 @@
depends_on:
- WIQ_DB

prometheus:
image: prom/prometheus
container_name: prometheus-${teamname:-defaultASW}
profiles: ["dev", "prod"]
networks:
mynetwork:
volumes:
- ./quiz-api/monitoring/prometheus:/etc/prometheus
- prometheus_data:/prometheus
- /certs:/etc/letsencrypt/kiwiq.run.place:ro
depends_on:
- api

kiwiq:
image: ghcr.io/arquisoft/wiq_en2b/kiwiq:latest
container_name: kiwiq
Expand Down Expand Up @@ -99,16 +86,32 @@
- REACT_APP_API_ENDPOINT=${API_URI}
networks:
mynetwork:

prometheus:
image: ghcr.io/arquisoft/wiq_en2b/prometheus:latest
container_name: prometheus-${teamname:-defaultASW}
profiles: ["dev", "prod"]
ports:
- "9090:9090"
networks:
mynetwork:
volumes:
- prometheus_data:/prometheus
- /certs:/etc/letsencrypt/kiwiq.run.place:ro
depends_on:
- api

grafana:
image: grafana/grafana
image: ghcr.io/arquisoft/wiq_en2b/grafana:latest
container_name: grafana-${teamname:-defaultASW}
profiles: [ "dev" , "prod"]
networks:
mynetwork:
volumes:
- grafana_data:/var/lib/grafana
- ./quiz-api/monitoring/grafana/provisioning:/etc/grafana/provisioning
- /certs:/etc/letsencrypt/kiwiq.run.place:ro
ports:
- "9091:9091"
environment:
- GF_SERVER_HTTP_PORT=9091
- GF_AUTH_DISABLE_LOGIN_FORM=true
Expand Down