feat: Keycloak realm callcenter, auth-service OIDC login

This commit is contained in:
2026-10-07 11:50:34 +00:00
parent 9847e0439a
commit b95ff58928
3 changed files with 375 additions and 0 deletions
+47
View File
@@ -88,3 +88,50 @@ services:
depends_on:
postgres:
condition: service_healthy
keycloak:
image: quay.io/keycloak/keycloak:26.8.0
restart: unless-stopped
command: ["start", "--import-realm"]
env_file:
- ./keycloak/.env
environment:
KC_DB: postgres
KC_DB_URL: jdbc:postgresql://postgres:5432/keycloak
KC_DB_USERNAME: keycloak
KC_DB_POOL_MAX_SIZE: "10"
KC_HOSTNAME: https://aimaq.konturai.kz/auth
KC_HTTP_ENABLED: "true"
KC_HTTP_RELATIVE_PATH: /auth
KC_PROXY_HEADERS: xforwarded
KC_HEALTH_ENABLED: "true"
KC_CACHE: local
KC_LOG_LEVEL: INFO
JAVA_OPTS_KC_HEAP: "-XX:MaxRAMPercentage=65 -XX:InitialRAMPercentage=30"
volumes:
- ./keycloak/callcenter-realm.json:/opt/keycloak/data/import/callcenter-realm.json:ro
mem_limit: 900m
healthcheck:
test: ["CMD-SHELL", "exec 3<>/dev/tcp/127.0.0.1/9000 && printf 'GET /auth/health/ready HTTP/1.1\\r\\nHost: localhost\\r\\nConnection: close\\r\\n\\r\\n' >&3 && grep -q UP <&3"]
interval: 15s
timeout: 5s
retries: 20
start_period: 90s
depends_on:
postgres:
condition: service_healthy
networks:
- default
- common_network
auth-service:
env_file:
- ./.env.production
- ./keycloak/auth-client.env
environment:
OIDC_ENABLED: "1"
OIDC_PROVIDER: keycloak
OIDC_ISSUER_URL: https://aimaq.konturai.kz/auth/realms/callcenter
OIDC_CLIENT_ID: callcenter-auth
OIDC_REDIRECT_URI: https://aimaq.konturai.kz/proxy/auth/auth/oidc/callback
OIDC_SCOPES: openid profile email
OIDC_ROLE_CLAIM: roles
OIDC_ROLE_MAP_JSON: '{"admin":"admin","supervisor":"supervisor","operator":"operator","analyst":"analyst"}'