From f4dcd8da557b2d42022d2b915e3dffe76e58b4f3 Mon Sep 17 00:00:00 2001 From: Peter Muriuki Date: Wed, 4 Dec 2024 21:32:11 +0300 Subject: [PATCH] Fix Docker setup files Update readme.md --- .dockerignore | 11 +++++++++++ Dockerfile | 21 +++++++++++++-------- README.md | 2 ++ docker-compose.yml | 2 +- 4 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..24224da --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +**/*.db +**/.env +**/.git* +**/.waypoint +**/build +node_modules +dist_keycloak +dist +Dockerfile +README.md +.dockerignore diff --git a/Dockerfile b/Dockerfile index 3a34c77..7265663 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,22 @@ FROM node:22-alpine AS build -RUN apt-get update \ - && apt-get install -y maven +RUN apk update && apk add maven -WORKDIR /srv -ADD package.json . -ADD yarn.lock . +WORKDIR /themes + +RUN corepack enable + +# Copy dependency files first +COPY package.json yarn.lock .yarnrc.yml ./ + +COPY . . + +RUN yarn install -RUN yarn -ADD . . RUN yarn build-keycloak-theme FROM node:22-alpine -COPY --from=build /srv/dist_keycloak/ /srv/ + +COPY --from=build /themes/dist_keycloak/ /themes/ CMD ["sh"] diff --git a/README.md b/README.md index aa506f3..4da9b67 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Opensrp Keycloak Theme +The vanilla (manually edited ftl files) themes can be found in the branch [vanilla-themes]() + This repository contains a custom Keycloak theme built using [Keycloakify](https://github.com/keycloakify/keycloakify) and the [Keycloakify starter repository](https://github.com/keycloakify/keycloakify-starter-webpack). The theme is designed for use with Keycloak and provides custom styling and layouts for the following authentications pages: - Login diff --git a/docker-compose.yml b/docker-compose.yml index 5958493..7386510 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: - "--http-relative-path /auth" - "--spi-theme-static-max-age=-1 --spi-theme-cache-themes=false --spi-theme-cache-templates=false" volumes: - - ./keycloak-theme.jar:/opt/keycloak/providers/keycloak-theme.jar + - ./dist_keycloak/keycloak-theme-for-kc-22-and-above.jar:/opt/keycloak/providers/keycloak-theme.jar ports: - "8080:8080" - "8443:8443"