Skip to content

Commit

Permalink
Use vendor neutral container vs docker
Browse files Browse the repository at this point in the history
  • Loading branch information
slominskir committed Apr 9, 2024
1 parent f873253 commit 16a958b
Show file tree
Hide file tree
Showing 13 changed files with 82 additions and 111 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN cd /app && gradle build -x test --no-watch-fs $OPTIONAL_CERT_ARG

################## Stage 1
FROM ${RUN_IMAGE} as runner
COPY --from=builder /app/docker/app/app-setup.env /
COPY --from=builder /app/container/app/app-setup.env /
USER root
RUN /server-setup.sh /app-setup.env wildfly_start_and_wait \
&& /app-setup.sh /app-setup.env config_keycloak_client \
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions container/keycloak/initd.d/00_config.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export KEYCLOAK_REALM=test-realm
export KEYCLOAK_RESOURCE=smoothness-demo
8 changes: 8 additions & 0 deletions container/keycloak/initd.d/01_login.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

. /lib.sh

echo "---------"
echo "| Login |"
echo "---------"
login
15 changes: 15 additions & 0 deletions container/keycloak/initd.d/02_realm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

. /lib.sh

echo "----------------"
echo "| Create Realm |"
echo "----------------"
# KEYCLOAK_REALM set in 00_config.env as it's a shared value
KEYCLOAK_SECRET=yHi6W2raPmLvPXoxqMA7VWbLAA2WN0eB
KEYCLOAK_REALM_DISPLAY_NAME="TEST REALM"
# TIMEOUT UNITS IS SECONDS; 28800 Seconds = 8 Hours
KEYCLOAK_SESSION_IDLE_TIMEOUT=28800
# 86400 Seconds = 24 Hours
KEYCLOAK_SESSION_MAX_LIFESPAN=86400
create_realm
13 changes: 13 additions & 0 deletions container/keycloak/initd.d/03_client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

. /lib.sh

echo "-----------------"
echo "| Create Client |"
echo "-----------------"
# KEYCLOAK_RESOURCE set in 00_config.env as it's a shared value
KEYCLOAK_CLIENT_NAME=smoothness-demo
KEYCLOAK_SERVICE_ACCOUNT_ENABLED=true
KEYCLOAK_REDIRECT_URIS='["https://localhost:8443/smoothness-demo/*"]'
KEYCLOAK_SECRET=yHi6W2raPmLvPXoxqMA7VWbLAA2WN0eB
create_client
42 changes: 42 additions & 0 deletions container/keycloak/initd.d/04_accounts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

. /lib.sh

echo "----------------"
echo "| Create Roles |"
echo "----------------"
KEYCLOAK_ROLE_NAME=${KEYCLOAK_RESOURCE}-user
create_role
KEYCLOAK_ROLE_NAME=${KEYCLOAK_RESOURCE}-admin
create_role


echo "----------------"
echo "| Create Users |"
echo "----------------"
KEYCLOAK_USERNAME=jadams
KEYCLOAK_FIRSTNAME=Jane
KEYCLOAK_LASTNAME=Adams
[email protected]
KEYCLOAK_PASSWORD=password
KEYCLOAK_ROLE_NAME=${KEYCLOAK_RESOURCE}-user
create_user
assign_role

KEYCLOAK_USERNAME=jsmith
KEYCLOAK_FIRSTNAME=John
KEYCLOAK_LASTNAME=Smith
[email protected]
create_user
assign_role


KEYCLOAK_USERNAME=tbrown
KEYCLOAK_FIRSTNAME=Tom
KEYCLOAK_LASTNAME=Brown
[email protected]
create_user
KEYCLOAK_ROLE_NAME=${KEYCLOAK_RESOURCE}-user
assign_role
KEYCLOAK_ROLE_NAME=${KEYCLOAK_RESOURCE}-admin
assign_role
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
- "1521:1521"
- "5500:5500"
volumes:
- ./docker/oracle/setup:/container-entrypoint-initdb.d
- ./container/oracle/initdb.d:/container-entrypoint-initdb.d

keycloak:
image: quay.io/keycloak/keycloak:20.0.5
Expand Down
33 changes: 0 additions & 33 deletions docker/keycloak/docker-entrypoint.sh

This file was deleted.

76 changes: 0 additions & 76 deletions docker/keycloak/setup.sh

This file was deleted.

0 comments on commit 16a958b

Please sign in to comment.