WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 1c93271

Browse files
committed
feat: it runs but keycloak is not reachable from outsite
1 parent b53419b commit 1c93271

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

main.tf

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ resource "azurerm_container_group" "minio_aci_container_group" {
527527
KC_HTTP_ENABLED = "true"
528528
KC_HOSTNAME_STRICT = "false"
529529
KC_PROXY_HEADERS = "xforwarded"
530-
KEYCLOAK_IMPORT = "/opt/keycloak/data/import/realm-config.json"
530+
KEYCLOAK_IMPORT = "/opt/keycloak/data/import/minio-realm-config.json"
531531
KC_DB = "mariadb"
532532
KC_DB_URL = "jdbc:mariadb://localhost:3306/${var.mariadb_database}"
533533
KC_DB_USERNAME = var.mariadb_user
@@ -541,6 +541,15 @@ resource "azurerm_container_group" "minio_aci_container_group" {
541541
protocol = "TCP"
542542
}
543543

544+
volume {
545+
name = "keycloak-data"
546+
mount_path = "/opt/keycloak/data"
547+
read_only = false
548+
storage_account_name = azurerm_storage_account.minio_storage_account.name
549+
storage_account_key = azurerm_storage_account.minio_storage_account.primary_access_key
550+
share_name = azurerm_storage_share.keycloak_share.name
551+
}
552+
544553
volume {
545554
name = "keycloak-realm-config"
546555
mount_path = "/opt/keycloak/data/import"
@@ -551,15 +560,6 @@ resource "azurerm_container_group" "minio_aci_container_group" {
551560
}
552561
}
553562

554-
volume {
555-
name = "keycloak-data"
556-
mount_path = "/opt/keycloak/data"
557-
read_only = false
558-
storage_account_name = azurerm_storage_account.minio_storage_account.name
559-
storage_account_key = azurerm_storage_account.minio_storage_account.primary_access_key
560-
share_name = azurerm_storage_share.keycloak_share.name
561-
}
562-
563563
commands = [
564564
"/bin/bash",
565565
"-c",
@@ -630,14 +630,18 @@ resource "azurerm_container_group" "minio_aci_container_group" {
630630
security {
631631
privilege_enabled = true
632632
}
633-
commands = ["minio", "server", "/data", "--console-address", ":9001", "--address", ":9000"]
633+
commands = [
634+
"/bin/sh",
635+
"-c",
636+
"until timeout 1 sh -c 'cat < /dev/null > /dev/tcp/localhost/8083' 2>/dev/null; do echo 'Waiting for Keycloak...'; sleep 2; done && minio server /data --console-address :9001 --address :9000"
637+
]
634638
liveness_probe {
635639
http_get {
636640
path = "/minio/health/live"
637641
port = 9000
638642
scheme = "http"
639643
}
640-
initial_delay_seconds = 30
644+
initial_delay_seconds = 200
641645
period_seconds = 10
642646
timeout_seconds = 5
643647
failure_threshold = 3

0 commit comments

Comments
 (0)