Add prometheus to compose setup

This commit is contained in:
Kieran 2023-12-22 10:59:27 +00:00
parent 83f51a4668
commit 935e8c673e
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
4 changed files with 33 additions and 4 deletions

View File

@ -2,8 +2,14 @@ FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
WORKDIR /app
#install npm
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get install -y nodejs
ENV NODE_MAJOR=20
RUN apt update && \
apt install -y ca-certificates curl gnupg && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt update && \
apt install nodejs -y
#run yarn install
COPY . .

View File

@ -17,6 +17,16 @@
},
"SiteUrl": "http://localhost:8001",
"Redis": "redis",
"Postgres": "User ID=postgres;Password=postgres;Database=void;Pooling=true;Host=postgres:5432"
"Postgres": "User ID=postgres;Password=postgres;Database=void;Pooling=true;Host=postgres:5432",
"Prometheus": {
"Url": "http://prometheus:9090",
"EgressQuery": "increase(egress{{file=\"{0}\"}}[1d])"
},
"MetadataStore": "postgres",
"DefaultFileStore": "local-disk",
"JwtSettings":{
"Issuer": "http://localhost:8001",
"Key": "my_very_strong_secret_key"
}
}
}

View File

@ -11,6 +11,7 @@ services:
- postgres
- redis
- clamav
- prometheus
redis:
image: "redis:alpine"
restart: unless-stopped
@ -28,4 +29,10 @@ services:
image: "clamav/clamav"
restart: unless-stopped
volumes:
- "./data/clamav:/var/lib/clamav"
- "./data/clamav:/var/lib/clamav"
prometheus:
image: bitnami/prometheus
restart: unless-stopped
volumes:
- "./data/prometheus:/opt/bitnami/prometheus/data"
- "./prometheus.yml:/opt/bitnami/prometheus/conf/prometheus.yml:ro"

6
prometheus.yml Normal file
View File

@ -0,0 +1,6 @@
global:
scrape_interval: "10s"
scrape_configs:
- job_name: void-cat
static_configs:
- targets: [ "web:9090" ]