binary1ne commited on
Commit
036e493
·
verified ·
1 Parent(s): 2959a10

Create docker-entrypoint.sh

Browse files
Files changed (1) hide show
  1. docker-entrypoint.sh +26 -0
docker-entrypoint.sh ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # Use runtime env vars, fallback to defaults
5
+ : "${USERNAME:=admin}"
6
+ : "${PASSWORD:=admin}"
7
+
8
+ export KEYCLOAK_ADMIN=$USERNAME
9
+ export KEYCLOAK_ADMIN_PASSWORD=$PASSWORD
10
+
11
+ # Get container hostname dynamically
12
+ HOSTNAME_VALUE=$(hostname)
13
+
14
+ echo ">>> Starting Keycloak"
15
+ echo " Admin: $KEYCLOAK_ADMIN"
16
+ echo " Hostname: $HOSTNAME_VALUE"
17
+
18
+ exec /opt/keycloak/bin/kc.sh start \
19
+ --http-port=7860 \
20
+ --http-enabled=true \
21
+ --http-host=0.0.0.0 \
22
+ --metrics-enabled=true \
23
+ --hostname-strict=false \
24
+ --proxy-headers=xforwarded \
25
+ --proxy=edge \
26
+ --hostname="${HOSTNAME_VALUE}"