skip to Main Content

I am trying to do this but not able to find any proper documentation to help me this is the image that I am using in my docker-compose file quay.io/keycloak/keycloak:21.0.2.

2

Answers


  1. This is a sample docker-compose.yml on which I confirmed keycloak looks working well.

    version: '3.8'
    
    services:
      postgres:
        image: postgres:13.2
        environment:
          POSTGRES_DB: keycloak
          POSTGRES_USER: keycloak
          POSTGRES_PASSWORD: password
        volumes:
          - postgres_data:/var/lib/postgresql/data
    
      keycloak:
        image: quay.io/keycloak/keycloak:21.0.2
        command: start-dev
        environment:
          DB_VENDOR: POSTGRES
          DB_ADDR: postgres
          DB_DATABASE: keycloak
          DB_USER: keycloak
          DB_PASSWORD: password
          KEYCLOAK_ADMIN: admin
          KEYCLOAK_ADMIN_PASSWORD: admin
        ports:
          - 8080:8080
        depends_on:
          - postgres
    
    volumes:
      postgres_data:
    
    Login or Signup to reply.
  2. You can aslo use bitnami/keycloak docker image. Below my docker-compose.yml:

    version: '3'
    
    services:
      postgresql:
        image: docker.io/bitnami/postgresql:11
        environment:
          # ALLOW_EMPTY_PASSWORD is recommended only for development.
          - ALLOW_EMPTY_PASSWORD=yes
          - POSTGRESQL_USERNAME=bn_keycloak
          - POSTGRESQL_DATABASE=bitnami_keycloak
        volumes:
          - 'postgresql_data:/bitnami/postgresql'
    
      keycloak:
        image: docker.io/bitnami/keycloak:21
        restart: always
        environment:
          KEYCLOAK_DATABASE_VENDOR: postgresql
          KEYCLOAK_CREATE_ADMIN_USER: true
          KEYCLOAK_ADMIN_USER: admin
          KEYCLOAK_ADMIN_PASSWORD: admin
          KEYCLOAK_MANAGEMENT_USER: manager
          KEYCLOAK_MANAGEMENT_PASSWORD: manager
        ports:
          - 8080:8080
        depends_on:
          - postgresql
    volumes:
      postgresql_data:
        driver: local
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search