Skip to content

Commit

Permalink
Merge pull request #50 from JavatoDev-com/49-keycloak-realm-export-se…
Browse files Browse the repository at this point in the history
…tup-with-docker-compose

49 keycloak realm export setup with docker compose
  • Loading branch information
chinthaka-dinadasa authored May 15, 2024
2 parents 7bc87ee + f6604b6 commit 9a969e6
Show file tree
Hide file tree
Showing 3 changed files with 2,711 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: '3.6'
services:
keycloak_web:
image: quay.io/keycloak/keycloak:23.0.7
# build: keycloak
container_name: keycloak_web
environment:
KC_DB: postgres
Expand All @@ -11,11 +12,13 @@ services:
KC_DB_PASSWORD: password
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: password
command: start-dev
command: ["start-dev", "--import-realm"]
depends_on:
- keycloakdb
ports:
- 8080:8080
volumes:
- ./keycloak:/opt/keycloak/data/import

keycloakdb:
image: postgres:15
Expand Down
13 changes: 13 additions & 0 deletions docker-compose/keycloak/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM quay.io/keycloak/keycloak:23.0.7

# Make the realm configuration available for import
COPY ./realm-export.json /opt/keycloak_import/

# Import the realm and user
RUN /opt/keycloak/bin/kc.sh import --optimized --file /opt/keycloak_import/realm-export.json

# The Keycloak server is configured to listen on port 8080
EXPOSE 8080

# Import the realm on start-up
CMD ["start-dev"]
Loading

0 comments on commit 9a969e6

Please sign in to comment.