Skip to content
Snippets Groups Projects
Verified Commit d7594641 authored by Martin Weise's avatar Martin Weise
Browse files

Separated healthcheck and disabling of tls for test deployment

parent a41c8a61
Branches
Tags
3 merge requests!231CI: Remove build for log-service,!228Better error message handling in the frontend,!223Release of version 1.4.0
......@@ -34,7 +34,8 @@ COPY ./dbrepo-realm.json /opt/keycloak/data/import/dbrepo-realm.json
WORKDIR /app
COPY ./healthcheck.sh ./healthcheck.sh
COPY ./docker-entrypoint.sh ./docker-entrypoint.sh
COPY ./disable-tls.sh ./disable-tls.sh
ENV AUTH_DB=keycloak
ENV AUTH_USERNAME=root
......@@ -52,6 +53,4 @@ ENV KEYCLOAK_IMPORT=/opt/keycloak/data/import/dbrepo-realm.json
ENV KEYCLOAK_ADMIN=fda
ENV KEYCLOAK_ADMIN_PASSWORD=fda
HEALTHCHECK --interval=10s --timeout=5s --retries=12 CMD ["bash", "/app/healthcheck.sh"]
ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start-dev", "--import-realm"]
ENTRYPOINT [ "bash", "/app/docker-entrypoint.sh" ]
This diff is collapsed.
#!/bin/bash
HTTP_CODE=$(curl --silent --output /dev/stderr --write-out "%{http_code}" 'http://0.0.0.0:8080/realms/dbrepo')
if test $HTTP_CODE -ne 200; then
exit 1
fi
if [ ! -f /disabled ]; then
while [ ! -f /tls_disabled ]; do
cd /opt/keycloak/bin || exit 1
./kcadm.sh config credentials --server http://localhost:8080 --realm master --user "${KEYCLOAK_ADMIN}" --password "${KEYCLOAK_ADMIN_PASSWORD}"
if [ "$?" -ne 0 ]; then
echo "Keycloak not yet ready ..."
echo "Wait 5s ..."
sleep 5
else
./kcadm.sh update realms/master -s sslRequired=NONE
touch /disabled
echo "Successfully disabled TLS/SSL for realm 'master' ..."
touch /tls_disabled
fi
done
\ No newline at end of file
#!/bin/bash
bash /app/disable-tls.sh &
/opt/keycloak/bin/kc.sh start-dev --import-realm
......@@ -136,6 +136,11 @@ services:
ports:
- "8443:8443"
- "8080:8080"
healthcheck:
test: curl -sSL 'http://0.0.0.0:8080/realms/dbrepo' | grep "dbrepo" || exit 1
interval: 10s
timeout: 5s
retries: 12
environment:
AUTH_DB: "${AUTH_DB:-keycloak}"
KC_DB_USERNAME: "${AUTH_USERNAME:-root}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment