Skip to content

Instantly share code, notes, and snippets.

@ulexxander
Created September 21, 2023 20:10
Show Gist options
  • Save ulexxander/283e8de216cd203512bb53d6a4644092 to your computer and use it in GitHub Desktop.
Save ulexxander/283e8de216cd203512bb53d6a4644092 to your computer and use it in GitHub Desktop.
OIDC Proxying Docker container using oauth2-proxy.
services:
prometheus-proxy:
image: quay.io/oauth2-proxy/oauth2-proxy:v7.5.0
command:
- --http-address=:4180
- --upstream=http://prometheus:9090
- --email-domain=*
- --oidc-issuer-url=https://gitlab.com
- --provider=gitlab
- --redirect-url=http://prometheus-oauth.localhost/oauth2/callback
# Env file contents:
# OAUTH2_PROXY_CLIENT_ID=...
# OAUTH2_PROXY_CLIENT_SECRET=...
# OAUTH2_PROXY_COOKIE_SECRET=...
env_file: prometheus-proxy.env
expose:
- 4180
restart: always
labels:
- traefik.enable=true
- traefik.http.routers.prometheus-oauth.rule=Host(`prometheus-oauth.localhost`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment