docker-images/keycloak
2024-10-12 22:03:03 +02:00
..
builder.sh keycloak builder: set semver image tags 2024-10-12 22:03:03 +02:00
cache-persistent.xml FINALLY added persistant cache to keycloak 2024-03-03 14:48:07 +01:00
Dockerfile update for keycloak 26 2024-10-05 21:59:18 +02:00
README.md update keycloak doc url 2024-03-04 12:46:04 +01:00

thetadev256/keycloak

Optimized keycloak image with Postgres support and persistent cache (Sessions are preserved between restarts).

Original image source: https://quay.io/repository/keycloak/keycloak?tab=tags&tag=latest

Example docker-compose

Keycloak behind Traefik reverse proxy

version: "3"
services:
  keycloak:
    image: thetadev256/keycloak:latest
    restart: unless-stopped
    volumes:
      - keycloak-cache:/opt/keycloak/cache
    networks:
      - proxy
    environment:
      - KC_HOSTNAME=auth.example.com
      - KC_DB=postgres
      - KC_DB_URL=jdbc:postgresql://postgres/keycloak
      - KC_DB_USERNAME=postgres
      - KC_DB_PASSWORD=secret
      - KC_HTTP_ENABLED=true
      - KC_PROXY=edge
      - KEYCLOAK_ADMIN=admin
      - KEYCLOAK_ADMIN_PASSWORD=change_me
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=proxy"
      - "traefik.http.routers.keycloak.entrypoints=websecure"
      - "traefik.http.routers.keycloak.rule=Host(`auth.example.com`)"
      - "traefik.http.services.keycloak.loadbalancer.server.port=8080"
    command: ["start"]

networks:
  proxy:
    external: true

volumes:
  keycloak-cache:

Original documentation

Configuration options: https://www.keycloak.org/server/all-config

About the dockerfile: https://www.keycloak.org/server/containers