Develop: Add Prometheus test server configuration #213 #3730 #3943

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer 2023-12-09 20:34:50 +01:00
parent 837b2cfb40
commit e3857a45f9
2 changed files with 36 additions and 4 deletions

View file

@ -148,7 +148,7 @@ services:
MARIADB_PASSWORD: "photoprism"
MARIADB_ROOT_PASSWORD: "photoprism"
## HTTPS Reverse Proxy (recommended) ##
## HTTPS Reverse Test Proxy
## includes "*.localssl.dev" SSL certificate for test environments
## Docs: https://doc.traefik.io/traefik/
traefik:
@ -161,13 +161,13 @@ services:
volumes:
- "/var/run/docker.sock:/var/run/docker.sock" # enables Traefik to watch services
## Keycloak OpenID Connect Provider
## Keycloak Test Identity Provider
## Login: user / photoprism
## Admin: admin / photoprism
keycloak:
image: quay.io/keycloak/keycloak:22.0
command: "start-dev" # development mode, do not use this in production!
image: quay.io/keycloak/keycloak:23.0
container_name: keycloak
command: "start-dev" # development mode, do not use this in production!
links:
- "traefik:localssl.dev"
- "traefik:app.localssl.dev"
@ -191,6 +191,22 @@ services:
KC_DB_USERNAME: "keycloak"
KC_DB_PASSWORD: "keycloak"
## Prometheus Test Server
## Docs: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#oauth2
prometheus:
image: prom/prometheus:latest
container_name: prometheus
labels:
- "traefik.enable=true"
- "traefik.http.services.prometheus.loadbalancer.server.port=9090"
- "traefik.http.routers.prometheus.entrypoints=websecure"
- "traefik.http.routers.prometheus.rule=Host(`prometheus.localssl.dev`)"
- "traefik.http.routers.prometheus.tls.domains[0].main=localssl.dev"
- "traefik.http.routers.prometheus.tls.domains[0].sans=*.localssl.dev"
- "traefik.http.routers.prometheus.tls=true"
volumes:
- "./prometheus.yml:/etc/prometheus/prometheus.yml"
## Dummy LDAP Directory Server
## Docs: https://glauth.github.io/docs/
dummy-ldap:

16
prometheus.yml Normal file
View file

@ -0,0 +1,16 @@
global:
scrape_interval: 15s
scrape_timeout: 10s
scrape_configs:
- job_name: "photoprism"
metrics_path: "/api/v1/metrics"
oauth2:
client_id: "cs5cpu17n6gj2qo5"
client_secret: "xcCbOrw6I0vcoXzhnOmXhjpVSyFq0l0e"
token_url: "http://photoprism:2342/api/v1/oauth/token"
scopes:
- 'metrics'
endpoint_params:
grant_type: "client_credentials"
static_configs:
- targets: ["photoprism:2342"]