Commit 495531f9 authored by pawel-kow's avatar pawel-kow

Squashed commit of the following:

commit 27e4f933db387a26902fb431b8f77d525c2d771d
Author: pawel-kow <pawel-kow@users.noreply.github.com>
Date:   Wed Jul 29 05:34:22 2020 +0000

    Updated POSTGRES variables

commit 28a41fece24a23f3aabd908f1a00d17bd89d34f2
Author: pawel-kow <pawel-kow@users.noreply.github.com>
Date:   Wed Jul 29 05:24:45 2020 +0000

    Manifest upgraded to version 2

commit b2797cb2ee6faa0f56d7fd13eeb87a4114839c0d
Author: pawel-kow <pawel-kow@users.noreply.github.com>
Date:   Tue Jul 28 12:41:17 2020 +0000

    Working image on cloudron base
parent 8f920ce9
......@@ -14,7 +14,7 @@
"postgresql": {},
"sendmail": {}
},
"manifestVersion": 1,
"manifestVersion": 2,
"website": "https://id4me.org",
"contactEmail": "pawel.kowalik@ionos.com",
"icon": "file://ID4me_Logo_75x35_RGB.png",
......
FROM jboss/keycloak:9.0.0
FROM registry.gitlab.com/id4me/openid4meprovider_keycloak_backend/keycloak-cloudron:9.0.0
USER root
COPY --from=gosu/assets /opt/gosu /opt/gosu
RUN /opt/gosu/gosu.install.sh && rm -fr /opt/gosu
RUN mkdir -p /app/data && chown -R jboss:jboss /app/data \
&& mkdir -p /tmp/keycloak && chown -R jboss:jboss /tmp/keycloak \
RUN mkdir -p /app/data && chown -R 1000:1000 /app/data \
&& mkdir -p /tmp/keycloak && chown -R 1000:1000 /tmp/keycloak \
&& mv /opt/jboss/keycloak/standalone/log /opt/jboss/keycloak/standalone/log.orig \
&& mkdir /app/data/log \
&& ln -sf /app/data/log /opt/jboss/keycloak/standalone/log \
......@@ -20,16 +20,12 @@ RUN mkdir -p /app/data && chown -R jboss:jboss /app/data \
&& rm -fr /opt/jboss/keycloak/standalone/tmp \
&& ln -sf /tmp/keycloak /opt/jboss/keycloak/standalone/tmp
RUN microdnf update -y && microdnf install -y openldap-clients && microdnf clean all
ADD cloudron_tools /opt/jboss/cloudron_tools
ADD config /opt/jboss/cloudtron_config
ADD themes/address /opt/jboss/keycloak/themes/address
RUN chown -R jboss:jboss /opt/jboss/cloudtron_config \
&& chown -R jboss:jboss /opt/jboss/keycloak/themes/address
ENTRYPOINT [ "/opt/jboss/cloudron_tools/entrypoint.sh" ]
RUN chown -R 1000:1000 /opt/jboss/cloudtron_config \
&& chown -R 1000:1000 /opt/jboss/keycloak/themes/address
#CMD [ "-bmanagement=0.0.0.0" ]
\ No newline at end of file
ENTRYPOINT [ "/opt/jboss/cloudron_tools/entrypoint.sh" ]
\ No newline at end of file
#!/bin/bash
NOW=$(date +%s) && docker build -t registry.gitlab.com/id4me/openid4meprovider_keycloak_backend:$NOW . && docker push registry.gitlab.com/id4me/openid4meprovider_keycloak_backend:$NOW && cloudron install --image registry.gitlab.com/id4me/openid4meprovider_keycloak_backend:$NOW -l id.domainid.community
cloudron logs -f --app id.domainid.community
\ No newline at end of file
FROM cloudron/base:2.0.0@sha256:f9fea80513aa7c92fe2e7bf3978b54c8ac5222f47a9a32a7f8833edf0eb5a4f4
ENV KEYCLOAK_VERSION 9.0.0
ENV JDBC_POSTGRES_VERSION 42.2.5
ENV JDBC_MYSQL_VERSION 8.0.19
ENV JDBC_MARIADB_VERSION 2.5.4
ENV JDBC_MSSQL_VERSION 7.4.1.jre11
ENV LAUNCH_JBOSS_IN_BACKGROUND 1
ENV PROXY_ADDRESS_FORWARDING false
ENV JBOSS_HOME /opt/jboss/keycloak
ENV LANG en_US.UTF-8
#ENV LANGUAGE=en_US.UTF-8
#ENV LC_ALL=en_US.UTF-8
#ENV LC_TYPE=en_US.UTF-8
ARG GIT_REPO
ARG GIT_BRANCH
ARG KEYCLOAK_DIST=https://downloads.jboss.org/keycloak/$KEYCLOAK_VERSION/keycloak-$KEYCLOAK_VERSION.tar.gz
USER root
RUN apt-get update -y && apt-get install -y locales && locale-gen en_US.UTF-8 && dpkg-reconfigure locales
RUN apt-get install -y gzip hostname openjdk-11-jre-headless openssl tar && apt-get clean all
COPY --from=jboss/keycloak:9.0.0 /opt/jboss/tools /opt/jboss/tools
RUN /opt/jboss/tools/build-keycloak.sh
USER 1000
EXPOSE 8080
EXPOSE 8443
ENTRYPOINT [ "/opt/jboss/tools/docker-entrypoint.sh" ]
CMD ["-b", "0.0.0.0"]
\ No newline at end of file
#!/bin/bash
DOMAIN=<domain_name>
docker build -t registry.gitlab.com/id4me/openid4meprovider_keycloak_backend/keycloak-cloudron:9.0.0 ./build && docker push registry.gitlab.com/id4me/openid4meprovider_keycloak_backend/keycloak-cloudron:9.0.0
TAG=9.0.0_6 && docker build -t registry.gitlab.com/id4me/openid4meprovider_keycloak_backend:$TAG . && docker push registry.gitlab.com/id4me/openid4meprovider_keycloak_backend:$TAG && cloudron install --image registry.gitlab.com/id4me/openid4meprovider_keycloak_backend:$TAG -l $DOMAIN
cloudron logs -f --app $DOMAIN
\ No newline at end of file
#!/bin/sh
set -euo pipefail
#!/bin/bash
set -eou pipefail
ADD_PARAMS=""
if [[ ! -f /app/data/.initialized ]]; then
echo "Fresh installation, setting up data directory..."
if [[ -z "${LDAP_BIND_DN+x}" ]]; then
echo "LDAP enabled"
LDAP_ENABLED="false"
if [[ -z "${INIT_KEYCLOAK_USER+x}" ]]; then
echo "init user disabled"
else
export KEYCLOAK_USER=$INIT_KEYCLOAK_USER
export KEYCLOAK_PASSWORD=$INIT_KEYCLOAK_PASSWORD
fi
if [[ -z "${CLOUDRON_LDAP_BIND_DN+x}" ]]; then
echo "LDAP disabled"
LDAP_ENABLED="true"
CLOUDRON_LDAP_ENABLED="false"
else
echo "LDAP enabled"
CLOUDRON_LDAP_ENABLED="true"
fi
cat /opt/jboss/cloudtron_config/full-export.json \
| sed 's/{{LDAP_ENABLED}}/'${LDAP_ENABLED:-false}'/g' \
| sed 's/{{LDAP_BIND_DN}}/'${LDAP_BIND_DN:-cn=dummy,ou=apps,dc=cloudron}'/g' \
| sed 's/{{LDAP_BIND_PASSWORD}}/'${LDAP_BIND_PASSWORD:-***}'/g' \
| sed 's/{{LDAP_GROUPS_BASE_DN}}/'${LDAP_GROUPS_BASE_DN:-ou=groups,dc=cloudron}'/g' \
| sed 's/{{LDAP_PORT}}/'${LDAP_PORT:-}'/g' \
| sed 's/{{LDAP_SERVER}}/'${LDAP_SERVER:-}'/g' \
| sed 's@{{LDAP_URL}}@'${LDAP_URL:-http://localhost:8080}'@g' \
| sed 's/{{LDAP_USERS_BASE_DN}}/'${LDAP_USERS_BASE_DN:-ou=users,dc=cloudron}'/g' \
| sed 's/{{MAIL_SMTPS_PORT}}/'${MAIL_SMTPS_PORT:-1234}'/g' \
| sed 's/{{MAIL_SMTP_PASSWORD}}/'${MAIL_SMTP_PASSWORD:-***}'/g' \
| sed 's/{{MAIL_SMTP_PORT}}/'${MAIL_SMTP_PORT:-1234}'/g' \
| sed 's/{{MAIL_SMTP_SERVER}}/'${MAIL_SMTP_SERVER:-10.0.0.1}'/g' \
| sed 's/{{MAIL_SMTP_USERNAME}}/'${MAIL_SMTP_USERNAME:-dummy}'/g' \
| sed 's/{{LDAP_ENABLED}}/'${CLOUDRON_LDAP_ENABLED:-false}'/g' \
| sed 's/{{LDAP_BIND_DN}}/'${CLOUDRON_LDAP_BIND_DN:-cn=dummy,ou=apps,dc=cloudron}'/g' \
| sed 's/{{LDAP_BIND_PASSWORD}}/'${CLOUDRON_LDAP_BIND_PASSWORD:-***}'/g' \
| sed 's/{{LDAP_GROUPS_BASE_DN}}/'${CLOUDRON_LDAP_GROUPS_BASE_DN:-ou=groups,dc=cloudron}'/g' \
| sed 's/{{LDAP_PORT}}/'${CLOUDRON_LDAP_PORT:-}'/g' \
| sed 's/{{LDAP_SERVER}}/'${CLOUDRON_LDAP_SERVER:-}'/g' \
| sed 's@{{LDAP_URL}}@'${CLOUDRON_LDAP_URL:-http://localhost:8080}'@g' \
| sed 's/{{LDAP_USERS_BASE_DN}}/'${CLOUDRON_LDAP_USERS_BASE_DN:-ou=users,dc=cloudron}'/g' \
| sed 's/{{MAIL_SMTPS_PORT}}/'${CLOUDRON_MAIL_SMTPS_PORT:-1234}'/g' \
| sed 's/{{MAIL_SMTP_PASSWORD}}/'${CLOUDRON_MAIL_SMTP_PASSWORD:-***}'/g' \
| sed 's/{{MAIL_SMTP_PORT}}/'${CLOUDRON_MAIL_SMTP_PORT:-1234}'/g' \
| sed 's/{{MAIL_SMTP_SERVER}}/'${CLOUDRON_MAIL_SMTP_SERVER:-10.0.0.1}'/g' \
| sed 's/{{MAIL_SMTP_USERNAME}}/'${CLOUDRON_MAIL_SMTP_USERNAME:-dummy}'/g' \
> /run/full-export.json
ADD_PARAMS="-Dkeycloak.migration.action=import -Dkeycloak.migration.provider=singleFile -Dkeycloak.migration.strategy=OVERWRITE_EXISTING -Dkeycloak.migration.file=/run/full-export.json"
......@@ -43,11 +48,11 @@ chown -R jboss:jboss /app/data
chown -R jboss:jboss /tmp/keycloak
export DB_VENDOR="postgres"
export DB_ADDR=$POSTGRESQL_HOST
export DB_DATABASE=$POSTGRESQL_DATABASE
export DB_USER=$POSTGRESQL_USERNAME
export DB_PASSWORD=$POSTGRESQL_PASSWORD
export DB_PORT=$POSTGRESQL_PORT
export DB_ADDR=$CLOUDRON_POSTGRESQL_HOST
export DB_DATABASE=$CLOUDRON_POSTGRESQL_DATABASE
export DB_USER=$CLOUDRON_POSTGRESQL_USERNAME
export DB_PASSWORD=$CLOUDRON_POSTGRESQL_PASSWORD
export DB_PORT=$CLOUDRON_POSTGRESQL_PORT
export PROXY_ADDRESS_FORWARDING=true
#export KEYCLOAK_FRONTEND_URL=$APP_ORIGIN
echo "****************************************"
......@@ -55,4 +60,4 @@ echo "Vars after:"
set
echo "****************************************"
exec /usr/local/bin/gosu jboss:jboss /opt/jboss/tools/docker-entrypoint.sh "-Dkeycloak.profile=preview $ADD_PARAMS $@"
\ No newline at end of file
exec /usr/local/bin/gosu jboss:jboss /opt/jboss/tools/docker-entrypoint.sh "$ADD_PARAMS $@"
\ No newline at end of file
......@@ -3,13 +3,13 @@ services:
keycloak-wild:
build: .
environment:
KEYCLOAK_USER: "admin"
KEYCLOAK_PASSWORD: "password"
POSTGRESQL_HOST: "kc-wild-db"
POSTGRESQL_DATABASE: "keycloakdb"
POSTGRESQL_USERNAME: "keycloak"
POSTGRESQL_PASSWORD: "gn5501EUKJlRgoYuJ9Lq"
POSTGRESQL_PORT: "5432"
INIT_KEYCLOAK_USER: "admin"
INIT_KEYCLOAK_PASSWORD: "password"
CLOUDRON_POSTGRESQL_HOST: "kc-wild-db"
CLOUDRON_POSTGRESQL_DATABASE: "keycloakdb"
CLOUDRON_POSTGRESQL_USERNAME: "keycloak"
CLOUDRON_POSTGRESQL_PASSWORD: "gn5501EUKJlRgoYuJ9Lq"
CLOUDRON_POSTGRESQL_PORT: "5432"
APP_ORIGIN: "http://localhost:8080"
ports:
- "8080:8080"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment