2022-10-12 15:31:44 -07:00
|
|
|
|
|
|
|
services:
|
2024-01-08 11:44:38 -08:00
|
|
|
keycloak:
|
2024-07-22 10:26:29 -07:00
|
|
|
image: quay.io/keycloak/keycloak:latest
|
2024-01-08 11:44:38 -08:00
|
|
|
container_name: keycloak_keycloak
|
|
|
|
networks:
|
|
|
|
keycloak:
|
|
|
|
aliases:
|
|
|
|
- keycloak
|
|
|
|
web:
|
|
|
|
aliases:
|
|
|
|
- keycloak
|
|
|
|
restart: "no"
|
|
|
|
depends_on:
|
|
|
|
- postgres
|
2024-07-17 15:52:56 -07:00
|
|
|
command: start --hostname=keycloak.jafner.net
|
2024-08-12 16:39:28 -07:00
|
|
|
secrets:
|
|
|
|
- keycloak_KC_DB_PASSWORD
|
|
|
|
- keycloak_DB_PASS
|
|
|
|
- keycloak_KEYCLOAK_ADMIN_PASSWORD
|
|
|
|
environment:
|
|
|
|
KC_DB: postgres
|
|
|
|
KC_DB_URL: jdbc:postgresql://postgres/keycloak
|
|
|
|
KC_DB_USERNAME: keycloak
|
|
|
|
KC_HOSTNAME_URL: https://keycloak.jafner.net
|
|
|
|
KC_PROXY: edge
|
|
|
|
KC_HEALTH_ENABLED: true
|
|
|
|
KC_METRICS_ENABLED: true
|
|
|
|
KEYCLOAK_ADMIN: Jafner
|
|
|
|
KC_DB_PASSWORD: /run/secrets/keycloak_KC_DB_PASSWORD
|
|
|
|
DB_PASS: /run/secrets/keycloak_DB_PASS
|
|
|
|
KEYCLOAK_ADMIN_PASSWORD: /run/secrets/keycloak_KEYCLOAK_ADMIN_PASSWORD
|
2024-01-08 11:44:38 -08:00
|
|
|
labels:
|
|
|
|
traefik.http.routers.keycloak.rule: Host(`keycloak.jafner.net`)
|
|
|
|
traefik.http.routers.keycloak.tls.certresolver: lets-encrypt
|
|
|
|
traefik.http.routers.keycloak.middlewares: keycloak-redirect
|
|
|
|
traefik.http.services.keycloak.loadbalancer.server.port: 8080
|
|
|
|
traefik.http.middlewares.keycloak-redirect.redirectregex.regex: ^https:\\/\\/([^\\//]+)\\/?$$"
|
|
|
|
traefik.http.middlewares.keycloak-redirect.redirectregex.replacement: https://$$1/admin"
|
|
|
|
|
2022-10-17 08:44:09 -07:00
|
|
|
forwardauth:
|
2024-07-22 10:26:29 -07:00
|
|
|
image: mesosphere/traefik-forward-auth:latest
|
2022-10-17 08:44:09 -07:00
|
|
|
container_name: keycloak_forwardauth
|
|
|
|
networks:
|
|
|
|
web:
|
2022-10-17 10:09:11 -07:00
|
|
|
aliases:
|
|
|
|
- forwardauth
|
2022-10-17 08:44:09 -07:00
|
|
|
restart: "no"
|
2024-02-15 01:05:11 -08:00
|
|
|
command: "./traefik-forward-auth"
|
2023-04-06 12:37:10 -07:00
|
|
|
depends_on:
|
2024-03-08 20:44:10 -08:00
|
|
|
- keycloak
|
2022-11-01 00:33:30 -07:00
|
|
|
env_file:
|
2024-02-15 00:16:48 -08:00
|
|
|
- path: ./forwardauth.env
|
|
|
|
required: true
|
|
|
|
- path: ./forwardauth_secrets.env
|
|
|
|
required: false
|
2024-08-12 16:39:28 -07:00
|
|
|
secrets:
|
|
|
|
- forwardauth_CLIENT_SECRET
|
|
|
|
- forwardauth_SECRET
|
|
|
|
- forwardauth_ENCRYPTION_KEY
|
|
|
|
environment:
|
|
|
|
PROVIDER_URI: "https://keycloak.jafner.net/realms/Jafner.net"
|
|
|
|
CLIENT_ID: "traefik-forward-auth"
|
|
|
|
LOG_LEVEL: "debug"
|
|
|
|
CLIENT_SECRET: /run/secrets/forwardauth_CLIENT_SECRET
|
|
|
|
SECRET: /run/secrets/forwardauth_SECRET
|
|
|
|
ENCRYPTION_KEY: /run/secrets/forwardauth_ENCRYPTION_KEY
|
2022-10-17 08:44:09 -07:00
|
|
|
labels:
|
2022-11-01 01:00:18 -07:00
|
|
|
- "traefik.enable=false"
|
2022-10-17 08:44:09 -07:00
|
|
|
- "traefik.http.routers.forwardauth.rule=Path(`/_oauth`)"
|
|
|
|
- "traefik.http.routers.forwardauth.tls.certresolver=lets-encrypt"
|
2023-01-11 21:09:25 -08:00
|
|
|
|
|
|
|
forwardauth-privileged:
|
2024-07-22 10:26:29 -07:00
|
|
|
image: mesosphere/traefik-forward-auth:latest
|
2023-01-11 21:09:25 -08:00
|
|
|
container_name: keycloak_forwardauth-privileged
|
|
|
|
networks:
|
|
|
|
web:
|
|
|
|
aliases:
|
2023-01-11 21:49:05 -08:00
|
|
|
- forwardauth-privileged
|
2023-01-11 21:09:25 -08:00
|
|
|
restart: "no"
|
2024-02-15 01:05:11 -08:00
|
|
|
command: "./traefik-forward-auth --whitelist=jafner425@gmail.com"
|
2023-04-06 12:37:10 -07:00
|
|
|
depends_on:
|
2024-03-08 20:44:10 -08:00
|
|
|
- keycloak
|
2024-08-12 16:39:28 -07:00
|
|
|
secrets:
|
|
|
|
- forwardauth_privileged_CLIENT_SECRET
|
|
|
|
- forwardauth_privileged_SECRET
|
|
|
|
- forwardauth_privileged_ENCRYPTION_KEY
|
|
|
|
environment:
|
|
|
|
PROVIDER_URI: "https://keycloak.jafner.net/realms/Jafner.net"
|
|
|
|
CLIENT_ID: "traefik-forward-auth-privileged"
|
|
|
|
LOG_LEVEL: "debug"
|
|
|
|
CLIENT_SECRET: /run/secrets/forwardauth_privileged_CLIENT_SECRET
|
|
|
|
SECRET: /run/secrets/forwardauth_privileged_SECRET
|
|
|
|
ENCRYPTION_KEY: /run/secrets/forwardauth_privileged_ENCRYPTION_KEY
|
2023-01-11 21:09:25 -08:00
|
|
|
labels:
|
|
|
|
- "traefik.enable=false"
|
2023-01-11 21:56:25 -08:00
|
|
|
- "traefik.http.routers.forwardauth-privileged.rule=Path(`/_oauth`)"
|
2023-01-11 21:09:25 -08:00
|
|
|
- "traefik.http.routers.forwardauth-privileged.tls.certresolver=lets-encrypt"
|
2024-01-04 15:46:14 -08:00
|
|
|
|
|
|
|
postgres:
|
2024-07-22 10:26:29 -07:00
|
|
|
image: postgres:latest
|
2024-01-04 15:46:14 -08:00
|
|
|
container_name: keycloak_postgres
|
|
|
|
networks:
|
|
|
|
- keycloak
|
2024-08-12 16:39:28 -07:00
|
|
|
secrets:
|
|
|
|
- postgres_POSTGRES_USER
|
|
|
|
- postgres_POSTGRES_PASSWORD
|
|
|
|
environment:
|
|
|
|
POSTGRES_DB: keycloak
|
|
|
|
POSTGRES_USER: /run/secrets/postgres_POSTGRES_USER
|
|
|
|
POSTGRES_PASSWORD: /run/secrets/postgres_POSTGRES_PASSWORD
|
2024-01-04 15:46:14 -08:00
|
|
|
volumes:
|
|
|
|
- postgres_data:/var/lib/postgresql/data
|
2022-10-12 15:31:44 -07:00
|
|
|
|
|
|
|
networks:
|
|
|
|
web:
|
|
|
|
external: true
|
2024-01-04 15:46:14 -08:00
|
|
|
keycloak:
|
2024-01-04 11:32:56 -08:00
|
|
|
|
2024-01-04 15:46:14 -08:00
|
|
|
volumes:
|
2024-01-08 11:41:52 -08:00
|
|
|
postgres_data:
|
2024-08-12 16:39:28 -07:00
|
|
|
|
|
|
|
secrets:
|
|
|
|
forwardauth_privileged_CLIENT_SECRET:
|
|
|
|
file: ./secrets/forwardauth_privileged_CLIENT_SECRET.txt
|
|
|
|
forwardauth_privileged_SECRET:
|
|
|
|
file: ./secrets/forwardauth_privileged_SECRET.txt
|
|
|
|
forwardauth_privileged_ENCRYPTION_KEY:
|
|
|
|
file: ./secrets/forwardauth_privileged_ENCRYPTION_KEY.txt
|
|
|
|
forwardauth_CLIENT_SECRET:
|
|
|
|
file: ./secrets/forwardauth_CLIENT_SECRET.txt
|
|
|
|
forwardauth_SECRET:
|
|
|
|
file: ./secrets/forwardauth_SECRET.txt
|
|
|
|
forwardauth_ENCRYPTION_KEY:
|
|
|
|
file: ./secrets/forwardauth_ENCRYPTION_KEY.txt
|
|
|
|
keycloak_KC_DB_PASSWORD:
|
|
|
|
file: ./secrets/keycloak_KC_DB_PASSWORD.txt
|
|
|
|
keycloak_DB_PASS:
|
|
|
|
file: ./secrets/keycloak_DB_PASS.txt
|
|
|
|
keycloak_KEYCLOAK_ADMIN_PASSWORD:
|
|
|
|
file: ./secrets/keycloak_KEYCLOAK_ADMIN_PASSWORD.txt
|
|
|
|
postgres_POSTGRES_USER:
|
|
|
|
file: ./secrets/postgres_POSTGRES_USER.txt
|
|
|
|
postgres_POSTGRES_PASSWORD:
|
|
|
|
file: ./secrets/postgres_POSTGRES_PASSWORD.txt
|