Skip to content

Commit

Permalink
[WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
agebhar1 committed Nov 3, 2024
1 parent 6a9332e commit 55bbe69
Show file tree
Hide file tree
Showing 4 changed files with 2,201 additions and 0 deletions.
56 changes: 56 additions & 0 deletions container/nginx-oauth2/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
services:
nginx:
image: docker.io/library/nginx:1.26.2-alpine3.20
volumes:
- ./etc/nginx/conf.d:/etc/nginx/conf.d:ro
ports:
- "8080:80/tcp"
restart: unless-stopped
depends_on:
- keycloak
- oauth2-proxy

keycloak:
image: quay.io/keycloak/keycloak:26.0
hostname: keycloak.localhost
environment:
KC_HTTP_PORT: 9080
KC_HEALTH_ENABLED: true
KC_BOOTSTRAP_ADMIN_USERNAME: admin
KC_BOOTSTRAP_ADMIN_PASSWORD: admin
ports:
- "9080:9080/tcp"
command:
- start-dev
- --import-realm
volumes:
- ./etc/keycloak:/opt/keycloak/data/import # [email protected], password=password
healthcheck:
test: [ "CMD-SHELL", "exec 3<>/dev/tcp/127.0.0.1/9000 && printf >&3 '%s\r\n' 'GET /health/ready HTTP/1.1' 'Host: localhost' 'Connection: close' '' && grep -q 'HTTP/1.1 200 OK' <&3" ]
interval: 30s
timeout: 5s
restart: unless-stopped

oauth2-proxy:
image: quay.io/oauth2-proxy/oauth2-proxy:v7.7.1
environment:
# https://oauth2-proxy.github.io/oauth2-proxy/configuration/overview#general-provider-options
OAUTH2_PROXY_CLIENT_ID: "oauth2-proxy"
OAUTH2_PROXY_CLIENT_SECRET: "72341b6d-7065-4518-a0e4-50ee15025608"
OAUTH2_PROXY_OIDC_ISSUER_URL: "http://keycloak.localhost:9080/realms/oauth2-proxy"
OAUTH2_PROXY_PROVIDER: "oidc"
# https://oauth2-proxy.github.io/oauth2-proxy/configuration/overview#cookie-options
# OAUTH2_PROXY_COOKIE_DOMAINS:
OAUTH2_PROXY_COOKIE_SECRET: "wenKY5NUBWSLO8CRh1a81K7I-sqROgoAfEpbXCKhtfI="
OAUTH2_PROXY_COOKIE_SECURE: "false"
# https://oauth2-proxy.github.io/oauth2-proxy/configuration/overview/#proxy-options
OAUTH2_PROXY_EMAIL_DOMAINS: "*"
OAUTH2_PROXY_REDIRECT_URL: "http://localhost:8080/oauth2/callback"
OAUTH2_PROXY_REVERSE_PROXY: "true"
OAUTH2_PROXY_WHITELIST_DOMAINS: "localhost:8080"
# https://oauth2-proxy.github.io/oauth2-proxy/configuration/overview#server-options
OAUTH2_PROXY_HTTP_ADDRESS: "0.0.0.0:4180"
restart: unless-stopped
depends_on:
- keycloak
Loading

0 comments on commit 55bbe69

Please sign in to comment.