Fixed docker build for testing purposes (#895)
* fixes the docker build, by using the theme * create to constant as it's not passed keycloak 14
This commit is contained in:
parent
9410b89ed4
commit
1a8cb6176e
6 changed files with 10 additions and 120 deletions
31
Dockerfile
31
Dockerfile
|
@ -1,32 +1,11 @@
|
||||||
ARG DEFAULT_KEYCLOAK_ENDPOINT='http:\/\/localhost:8180'
|
FROM maven:3.6.0-jdk-11-slim as builder
|
||||||
|
|
||||||
FROM node:16 as builder
|
|
||||||
|
|
||||||
ARG DEFAULT_KEYCLOAK_ENDPOINT
|
|
||||||
ARG KEYCLOAK_ENDPOINT
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# replace Keycloak endpoints
|
RUN mvn -f /app/keycloak-theme/pom.xml install
|
||||||
RUN sed -i "s/${DEFAULT_KEYCLOAK_ENDPOINT}/${KEYCLOAK_ENDPOINT}/g" import.mjs &&\
|
|
||||||
sed -i "s/${DEFAULT_KEYCLOAK_ENDPOINT}/${KEYCLOAK_ENDPOINT}/g" src/context/auth/keycloak.ts &&\
|
|
||||||
sed -i "s/adminv2//g" snowpack.config.js
|
|
||||||
|
|
||||||
# install dependencies and build application
|
FROM quay.io/keycloak/keycloak:14.0.0
|
||||||
RUN npm ci
|
COPY --from=builder /app/keycloak-theme/target/classes /opt/jboss/keycloak/themes/keycloak.v2
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
FROM nginx:stable
|
EXPOSE 8080
|
||||||
ARG DEFAULT_KEYCLOAK_ENDPOINT
|
|
||||||
ARG KEYCLOAK_ENDPOINT
|
|
||||||
|
|
||||||
COPY --from=builder /app/build /usr/share/nginx/html
|
|
||||||
|
|
||||||
# setup reverse proxy for Keycloak endpoint
|
|
||||||
COPY nginx-default.conf /etc/nginx/conf.d/default.conf
|
|
||||||
|
|
||||||
# replace Keycloak endpoints
|
|
||||||
RUN sed -i "s/${DEFAULT_KEYCLOAK_ENDPOINT}/${KEYCLOAK_ENDPOINT}/g" /etc/nginx/conf.d/default.conf
|
|
||||||
|
|
||||||
EXPOSE 80
|
|
||||||
|
|
|
@ -30,10 +30,10 @@ For development on this project you will need a running Keycloak server listenin
|
||||||
## Build and run through Docker
|
## Build and run through Docker
|
||||||
git checkout git@github.com:keycloak/keycloak-admin-ui.git
|
git checkout git@github.com:keycloak/keycloak-admin-ui.git
|
||||||
cd keycloak-admin-ui
|
cd keycloak-admin-ui
|
||||||
docker-compose build
|
docker build -t keycloak-v2 .
|
||||||
docker-compose up
|
docker run --name keycloak-v2 -d -p 127.0.0.1:8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin keycloak-v2 -Dprofile.feature.newadmin=enabled
|
||||||
|
|
||||||
You can reach the new admin interface at http://localhost
|
You can reach the new admin interface at `http://localhost:8080`. Then go to `Realm Settings --> Themes` and set Admin Console Theme to `keycloak.v2`.
|
||||||
|
|
||||||
If your Keycloak instance is not on `localhost:8180`, create a file `.env` with the following:
|
If your Keycloak instance is not on `localhost:8180`, create a file `.env` with the following:
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ mvn install
|
||||||
|
|
||||||
The jar created with `mvn install` needs to be deployed to a Maven repository. From there, it will become part of the Keycloak server build.
|
The jar created with `mvn install` needs to be deployed to a Maven repository. From there, it will become part of the Keycloak server build.
|
||||||
|
|
||||||
For development, you can also just copy the contents of `build/target/classes` to `<keycloak server>/themes/keycloak.v2`. Then restart the server.
|
For development, you can also just copy the contents of `./target/classes` to `<keycloak server>/themes/keycloak.v2`. Then restart the server.
|
||||||
|
|
||||||
# To Run
|
# To Run
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
<script id="environment" type="application/json">
|
<script id="environment" type="application/json">
|
||||||
{
|
{
|
||||||
"loginRealm": "${loginRealm}",
|
"loginRealm": "master",
|
||||||
"authServerUrl": "${authServerUrl}",
|
"authServerUrl": "${authServerUrl}",
|
||||||
"authUrl": "${authUrl}",
|
"authUrl": "${authUrl}",
|
||||||
"consoleBaseUrl": "${consoleBaseUrl}",
|
"consoleBaseUrl": "${consoleBaseUrl}",
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
server_name localhost;
|
|
||||||
|
|
||||||
gzip on;
|
|
||||||
gzip_disable "msie6";
|
|
||||||
gzip_comp_level 6;
|
|
||||||
gzip_min_length 1100;
|
|
||||||
gzip_buffers 16 8k;
|
|
||||||
gzip_proxied any;
|
|
||||||
gzip_types
|
|
||||||
text/plain
|
|
||||||
text/css
|
|
||||||
text/js
|
|
||||||
text/xml
|
|
||||||
text/javascript
|
|
||||||
application/javascript
|
|
||||||
application/json
|
|
||||||
application/xml
|
|
||||||
application/rss+xml
|
|
||||||
image/svg+xml;
|
|
||||||
|
|
||||||
location /auth/ {
|
|
||||||
client_max_body_size 0;
|
|
||||||
proxy_pass http://localhost:8180/auth/;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
|
||||||
}
|
|
||||||
|
|
||||||
error_page 500 502 503 504 /50x.html;
|
|
||||||
location = /50x.html {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
50
nginx.conf
50
nginx.conf
|
@ -1,50 +0,0 @@
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
server_name localhost;
|
|
||||||
|
|
||||||
#charset koi8-r;
|
|
||||||
#access_log /var/log/nginx/host.access.log main;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /auth/ {
|
|
||||||
proxy_pass http://localhost:8180/auth/;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#error_page 404 /404.html;
|
|
||||||
|
|
||||||
# redirect server error pages to the static page /50x.html
|
|
||||||
#
|
|
||||||
error_page 500 502 503 504 /50x.html;
|
|
||||||
location = /50x.html {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
}
|
|
||||||
|
|
||||||
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
|
|
||||||
#
|
|
||||||
#location ~ \.php$ {
|
|
||||||
# proxy_pass http://127.0.0.1;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
|
|
||||||
#
|
|
||||||
#location ~ \.php$ {
|
|
||||||
# root html;
|
|
||||||
# fastcgi_pass 127.0.0.1:9000;
|
|
||||||
# fastcgi_index index.php;
|
|
||||||
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
|
|
||||||
# include fastcgi_params;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# deny access to .htaccess files, if Apache's document root
|
|
||||||
# concurs with nginx's one
|
|
||||||
#
|
|
||||||
#location ~ /\.ht {
|
|
||||||
# deny all;
|
|
||||||
#}
|
|
||||||
}
|
|
Loading…
Reference in a new issue