This commit is contained in:
iTrooz 2025-10-04 18:58:22 +02:00 committed by GitHub
commit 6b7a8644dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 42 additions and 29 deletions

View file

@ -6,26 +6,15 @@ This is a demo [Docker Compose](https://docs.docker.com/compose/) setup for [Res
## Quickstart
Build `rest-server` in Docker:
Bring up the Docker Compose stack (Optionally add `--build` to build image from repository instead of downloading):
cd ../..
make docker_build
cd -
Bring up the Docker Compose stack:
docker-compose build
docker-compose up -d
docker compose up -d
Check if everything is up and running:
docker-compose ps
docker compose ps
Grafana will be running on [http://localhost:8030/](http://localhost:8030/) with username "admin" and password "admin". The first time you access it you will be asked to setup a data source. Configure it like this (make sure you name it "prometheus", as this is hardcoded in the example dashboard):
![Add data source](datasource.png)
The Rest Server dashboard can be accessed on [http://localhost:8030/dashboard/file/rest-server.json](http://localhost:8030/dashboard/file/rest-server.json).
Grafana will be running on [http://localhost:8030/](http://localhost:8030/) with username "admin" and password "admin". When you login, you should be greeted by the dashboard, without any data.
Prometheus can be accessed on [http://localhost:8020/](http://localhost:8020/).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

View file

@ -1,10 +1,9 @@
# Demo of rest-server with prometheus and grafana
version: '2'
services:
restserver:
# NOTE: You must run `make docker_build` in the repo root first
# NOTE: Use `docker compose up --build -d` to build the image locally
# If you want to run this in production, you want auth and tls!
image: restic/rest-server:latest
build:
context: ../..
dockerfile: Dockerfile
@ -34,11 +33,11 @@ services:
image: grafana/grafana
volumes:
- grafanadata:/var/lib/grafana
- ./dashboards:/dashboards
- ./grafana.ini:/etc/grafana/grafana.ini
- ./grafana:/etc/grafana
ports:
- "127.0.0.1:8030:3000"
environment:
GF_SECURITY_CSRF_TRUSTED_ORIGINS: grafana.example.com # Put your serving domain here
GF_USERS_DEFAULT_THEME: light
# GF_INSTALL_PLUGINS: grafana-clock-panel,grafana-simple-json-datasource
depends_on:

View file

@ -22,7 +22,7 @@
"name": "Graph",
"version": ""
},
{
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
@ -59,7 +59,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS-INFRA}",
"datasource": "prometheus",
"fill": 1,
"id": 1,
"legend": {
@ -135,7 +135,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS-INFRA}",
"datasource": "prometheus",
"fill": 1,
"id": 4,
"legend": {
@ -223,7 +223,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS-INFRA}",
"datasource": "prometheus",
"fill": 1,
"id": 2,
"legend": {
@ -299,7 +299,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS-INFRA}",
"datasource": "prometheus",
"fill": 1,
"id": 5,
"legend": {
@ -387,7 +387,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS-INFRA}",
"datasource": "prometheus",
"fill": 1,
"id": 3,
"legend": {
@ -463,7 +463,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS-INFRA}",
"datasource": "prometheus",
"fill": 1,
"id": 6,
"legend": {
@ -551,7 +551,7 @@
{
"allValue": null,
"current": {},
"datasource": "${DS_PROMETHEUS-INFRA}",
"datasource": "prometheus",
"hide": 0,
"includeAll": false,
"label": "Instance",
@ -634,4 +634,4 @@
"timezone": "",
"title": "Restic Rest Server",
"version": 8
}
}

View file

@ -311,3 +311,6 @@ path = /dashboards
# Url used to to import dashboards directly from Grafana.net
[grafana_net]
url = https://grafana.net
[dashboards]
default_home_dashboard_path = /etc/grafana/dashboards/rest-server.json

View file

@ -0,0 +1,13 @@
apiVersion: 1
providers:
- name: 'default'
orgId: 1
folder: ''
type: file
disableDeletion: false
editable: true
allowUiUpdates: true
options:
# Path to dashboard files on disk
path: /etc/grafana/dashboards

View file

@ -0,0 +1,9 @@
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
uid: prometheus

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB