최대 1 분 소요

Setup keycloak using docker


services:
  keycloak:
    image: quay.io/keycloak/keycloak:latest
    container_name: keycloak
    ports:
      - "9001:8080"
    environment:
      - KC_BOOTSTRAP_ADMIN_USERNAME=admin
      - KC_BOOTSTRAP_ADMIN_PASSWORD=admin
      - KC_DB=postgres
      - KC_DB_URL=jdbc:postgresql://postgres:5432/demo
      - KC_DB_USERNAME=user01
      - KC_DB_PASSWORD=user01!
    restart: unless-stopped
    command:
      - start-dev
    depends_on:
      postgres:
        condition: service_healthy

  postgres:
    image: postgres:16-alpine3.21
    container_name: postgres
    restart: unless-stopped
    environment:
      - POSTGRES_DB=demo
      - POSTGRES_USER=user01
      - POSTGRES_PASSWORD=user01
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U appuser01 -d demo"]
      interval: 10s
      timeout: 5s
      retries: 10
      start_period: 10s
volumes:
  postgres_data:

댓글남기기