diff --git a/KeyCloak/DockerFile b/Docker/Compose.yml similarity index 58% rename from KeyCloak/DockerFile rename to Docker/Compose.yml index f4f1470..b3af128 100644 --- a/KeyCloak/DockerFile +++ b/Docker/Compose.yml @@ -7,14 +7,20 @@ services: networks: - keycloak_net environment: - KEYCLOAK_ADMIN: ${KEYCLOAK_USER} + KEYCLOAK_ADMIN: ${KEYCLOAK_USER} KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_PASSWORD} - command: - - start-dev + command: + - start-dev - --import-realm volumes: - ./Multiplied.json:/opt/keycloak/data/import/realm.json + app: + container_name: keycloak_net + ports: + - "8081:8080" + networks: + - keycloak_net + build: ../KeycloakIntegration/ networks: - keycloak_net: - name: keycloak_net - external: true \ No newline at end of file + keycloak_net: + name: keycloak_net diff --git a/KeyCloak/Multiplied.json b/Docker/Multiplied.json similarity index 100% rename from KeyCloak/Multiplied.json rename to Docker/Multiplied.json diff --git a/KeyCloak/env b/Docker/env similarity index 78% rename from KeyCloak/env rename to Docker/env index 30fbb2c..973ec67 100644 --- a/KeyCloak/env +++ b/Docker/env @@ -1,5 +1,5 @@ COMPOSE_FILE_SEPARATOR=; -COMPOSE_FILE=DockerFile +COMPOSE_FILE=Compose.yml KEYCLOAK_VERSION=26.0.0 KEYCLOAK_USER=admin diff --git a/README.md b/README.md index 82ac67b..96433f0 100644 --- a/README.md +++ b/README.md @@ -10,18 +10,13 @@ For full development capabilities, it is recommended to use Visual Studio on Win --- -# KeyCloak Setup +# Environment Setup 1. Install [Docker](https://www.docker.com/products/docker-desktop/) -1. Create the operational network with the following command `docker network create keycloak_net` -1. From [Keycloak DockerFile directory](/KeyCloak/) run : `docker-compose --env-file env up --build -d` - 1. user name and password can be edited form the [env file](/KeyCloak/env) +1. From [Docker compose folder](/Docker/) run : `docker-compose --env-file env up --build -d` + 1. user name and password for Keycloak can be edited form the [env file](/KeyCloak/env) 1. Keycloak version can be updated from the [env file](/KeyCloak/env) 1. Seed Realm, Clients and Users can be edited from the [realm json file](/KeyCloak/Multiplied.json) or a different json file can be reference from the [env file](/KeyCloak/env) 1. Log in into [Keycloak](http://localhost:8080/admin) - -# DotNet Setup -1. From [.NET DockerFile directory](/KeyCloakIntegration/) run: `docker build -t dotnet_keycloak-image -f DockerFile .` -1. Start app with the following command `docker run --net keycloak_net --name dotnet_app -d -p 8081:8080 dotnet_keycloak-image` 1. Navigate to [app](http://localhost:8081/) # GitHub Actions