Compare commits
3 Commits
grafana-v0
...
3edf33ccc2
| Author | SHA1 | Date | |
|---|---|---|---|
| 3edf33ccc2 | |||
| 83a467888f | |||
| 2541fae443 |
85
.gitea/workflows/action-build-and-push.yaml
Normal file
85
.gitea/workflows/action-build-and-push.yaml
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
name: Docker Build & Push to GitHub Container Registry (Use git tags with format vX.Y.Z as release version)
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
image_name:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
description: >
|
||||||
|
Docker image name without registry and owner.
|
||||||
|
Example: observability/alloy
|
||||||
|
|
||||||
|
build_context:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: .
|
||||||
|
description: >
|
||||||
|
Path to the Docker build context.
|
||||||
|
Example: . or ./services/api
|
||||||
|
|
||||||
|
file_path:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: ./Dockerfile
|
||||||
|
description: >
|
||||||
|
Path to the Dockerfile relative to the repository root.
|
||||||
|
Example: ./Dockerfile or ./services/api/Dockerfile
|
||||||
|
|
||||||
|
platforms:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: linux/amd64,linux/arm64
|
||||||
|
description: >
|
||||||
|
Comma-separated list of target platforms to build.
|
||||||
|
Example: linux/amd64,linux/arm64
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up QEMU (for cross-arch builds)
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
with:
|
||||||
|
platforms: arm64
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Ensure lowercase username because some registries do not allow uppercase letters
|
||||||
|
id: lowercase
|
||||||
|
run: echo "username=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ghcr.io/${{ steps.lowercase.outputs.username }}/${{ inputs.image_name }}
|
||||||
|
tags: |
|
||||||
|
type=match,pattern=.*(v\d+\.\d+\.\d+),group=1
|
||||||
|
type=match,pattern=.*(v\d+\.\d+)\.\d+,group=1
|
||||||
|
type=match,pattern=.*(v\d+)\.\d+\.\d+,group=1
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: ${{ inputs.build_context }}
|
||||||
|
file: ${{ inputs.file_path }}
|
||||||
|
platforms: ${{ inputs.platforms }}
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
17
.gitea/workflows/b&p-observability-alloy.yaml
Normal file
17
.gitea/workflows/b&p-observability-alloy.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: Build and Push Alloy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "alloy-v*.*.*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
uses: ./.github/workflows/action-build-and-push.yaml
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
with:
|
||||||
|
image_name: observability/alloy
|
||||||
|
build_context: ./observability/alloy
|
||||||
|
file_path: ./observability/alloy/Dockerfile
|
||||||
17
.gitea/workflows/b&p-observability-grafana.yaml
Normal file
17
.gitea/workflows/b&p-observability-grafana.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: Build and Push Grafana Observability
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "grafana-v*.*.*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
uses: ./.github/workflows/action-build-and-push.yaml
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
with:
|
||||||
|
image_name: observability/grafana
|
||||||
|
build_context: ./observability/grafana
|
||||||
|
file_path: ./observability/grafana/Dockerfile
|
||||||
17
.gitea/workflows/b&p-observability-loki.yaml
Normal file
17
.gitea/workflows/b&p-observability-loki.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: Build and Push Loki Database
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "loki-v*.*.*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
uses: ./.github/workflows/action-build-and-push.yaml
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
with:
|
||||||
|
image_name: observability/loki
|
||||||
|
build_context: ./observability/loki
|
||||||
|
file_path: ./observability/loki/Dockerfile
|
||||||
17
.gitea/workflows/b&p-observability-prometheus.yaml
Normal file
17
.gitea/workflows/b&p-observability-prometheus.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: Build and Push Prometheus Observability
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "prometheus-v*.*.*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
uses: ./.github/workflows/action-build-and-push.yaml
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
with:
|
||||||
|
image_name: observability/prometheus
|
||||||
|
build_context: ./observability/prometheus
|
||||||
|
file_path: ./observability/prometheus/Dockerfile
|
||||||
14
.github/workflows/action-build-and-push.yaml
vendored
14
.github/workflows/action-build-and-push.yaml
vendored
@@ -26,6 +26,14 @@ on:
|
|||||||
Path to the Dockerfile relative to the repository root.
|
Path to the Dockerfile relative to the repository root.
|
||||||
Example: ./Dockerfile or ./services/api/Dockerfile
|
Example: ./Dockerfile or ./services/api/Dockerfile
|
||||||
|
|
||||||
|
platforms:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: linux/amd64,linux/arm64
|
||||||
|
description: >
|
||||||
|
Comma-separated list of target platforms to build.
|
||||||
|
Example: linux/amd64,linux/arm64
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -37,6 +45,11 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up QEMU (for cross-arch builds)
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
with:
|
||||||
|
platforms: arm64
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
@@ -66,6 +79,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: ${{ inputs.build_context }}
|
context: ${{ inputs.build_context }}
|
||||||
file: ${{ inputs.file_path }}
|
file: ${{ inputs.file_path }}
|
||||||
|
platforms: ${{ inputs.platforms }}
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ FROM prom/prometheus:latest
|
|||||||
|
|
||||||
# Copy Prometheus configuration
|
# Copy Prometheus configuration
|
||||||
COPY prometheus.yaml /etc/prometheus/prometheus.yaml
|
COPY prometheus.yaml /etc/prometheus/prometheus.yaml
|
||||||
|
COPY prometheus-compose.yaml /etc/prometheus/prometheus-compose.yaml
|
||||||
|
|
||||||
# Switch to default user and expose port
|
# Switch to default user and expose port
|
||||||
EXPOSE 9090
|
EXPOSE 9090
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Prometheus main configuration
|
# Prometheus main configuration
|
||||||
|
# This configuration is adapted for Docker Compose environment
|
||||||
|
|
||||||
global:
|
global:
|
||||||
scrape_interval: 30s
|
scrape_interval: 30s
|
||||||
|
|||||||
@@ -60,9 +60,6 @@ services:
|
|||||||
|
|
||||||
prometheus:
|
prometheus:
|
||||||
image: ghcr.io/obnitram/observability/prometheus:v0.2
|
image: ghcr.io/obnitram/observability/prometheus:v0.2
|
||||||
command:
|
|
||||||
- "--config.file=/etc/prometheus/prometheus.yml"
|
|
||||||
- "--storage.tsdb.path=/prometheus"
|
|
||||||
volumes:
|
volumes:
|
||||||
- prometheus-storage:/prometheus
|
- prometheus-storage:/prometheus
|
||||||
deploy:
|
deploy:
|
||||||
|
|||||||
Reference in New Issue
Block a user