version: "3"

services:
  postgres:
    image: postgres
    volumes:
      - db:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: keycloak
      POSTGRES_PASSWORD: keycloak
    ports:
      - 5432:5432
  keycloak:
    image: quay.io/keycloak/keycloak:23.0.3
    build: .
    command: start-dev
    volumes:
      - ./build/libs/keycloak-scim-1.0-SNAPSHOT-all.jar:/opt/keycloak/providers/keycloak-scim-1.0-SNAPSHOT-all.jar
    environment:
      KC_DB: postgres
      KC_DB_URL_HOST: postgres
      KC_DB_USERNAME: keycloak
      KC_DB_PASSWORD: keycloak
      KEYCLOAK_ADMIN: admin
      KEYCLOAK_ADMIN_PASSWORD: admin
      KC_LOG_LEVEL: INFO,sh.libre.scim:debug,de.captaingoldfish.scim:debug
    ports:
      - 127.0.0.1:8080:8080
    depends_on:
      - postgres

volumes:
  db:
