From b4975660431c275ce736e0431b98c39548200af1 Mon Sep 17 00:00:00 2001 From: burnettk Date: Mon, 17 Oct 2022 21:35:30 -0400 Subject: [PATCH] Squashed 'spiffworkflow-backend/' changes from 1965bfe2d..823e32eb8 823e32eb8 smash all containers bad7513c3 keycloak docker build for prod image git-subtree-dir: spiffworkflow-backend git-subtree-split: 823e32eb8eaa88a2b2eab9aa8ef2f3e52edea9e7 --- bin/smash_all_containers | 11 +++++++++++ keycloak/Dockerfile | 26 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100755 bin/smash_all_containers create mode 100644 keycloak/Dockerfile diff --git a/bin/smash_all_containers b/bin/smash_all_containers new file mode 100755 index 000000000..eb26841a7 --- /dev/null +++ b/bin/smash_all_containers @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +function error_handler() { + >&2 echo "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}." + exit "$2" +} +trap 'error_handler ${LINENO} $?' ERR +set -o errtrace -o errexit -o nounset -o pipefail + +docker ps | grep -Ev '(static|CONTAINER)' | awk '{print $1}' | xargs docker stop +docker ps -a | grep -Ev '(static|CONTAINER)' | awk '{print $1}' | xargs docker rm diff --git a/keycloak/Dockerfile b/keycloak/Dockerfile new file mode 100644 index 000000000..af750bdeb --- /dev/null +++ b/keycloak/Dockerfile @@ -0,0 +1,26 @@ +FROM quay.io/keycloak/keycloak:18.0.2 as builder + +ENV KEYCLOAK_LOGLEVEL="ALL" +ENV ROOT_LOGLEVEL="ALL" +ENV KC_HEALTH_ENABLED="true" +# ENV KC_METRICS_ENABLED=true +ENV PROXY_ADDRESS_FORWARDING="true" +ENV KC_HOSTNAME="keycloak.demo.spiffworkflow.org" +ENV KC_HOSTNAME_URL="https://keycloak.demo.spiffworkflow.org" +ENV KC_FEATURES="token-exchange,admin-fine-grained-authz" +# ENV KC_DB=postgres +# Install custom providers +# RUN curl -sL https://github.com/aerogear/keycloak-metrics-spi/releases/download/2.5.3/keycloak-metrics-spi-2.5.3.jar -o /opt/keycloak/providers/keycloak-metrics-spi-2.5.3.jar +RUN /opt/keycloak/bin/kc.sh build + +FROM quay.io/keycloak/keycloak:18.0.2 +COPY --from=builder /opt/keycloak/ /opt/keycloak/ +WORKDIR /opt/keycloak +# for demonstration purposes only, please make sure to use proper certificates in production instead +# RUN keytool -genkeypair -storepass password -storetype PKCS12 -keyalg RSA -keysize 2048 -dname "CN=server" -alias server -ext "SAN:c=DNS:localhost,IP:127.0.0.1" -keystore conf/server.keystore +# # change these values to point to a running postgres instance +# ENV KC_DB_URL= +# ENV KC_DB_USERNAME= +# ENV KC_DB_PASSWORD= +# ENV KC_HOSTNAME=localhost +ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]