Skip to content

Commit 5e48b86

Browse files
committed
Update compose files and makefile
Just some stuff that will probably need to be reverted before merge. Includes - build custom user federation test dependency in container instead of requiring local java build. - make container images use docker.io registry explicitly, for clarity. - include environment variable for container runtime, defaulting to docker for backward compatibility. The last two points ensure that podman can be used instead of docker.
1 parent 75233f2 commit 5e48b86

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

docker-compose.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
11
volumes:
22
postgres:
33
services:
4+
build-custom-user-federation:
5+
image: docker.io/gradle
6+
volumes:
7+
- ./custom-user-federation-example:/home/gradle:z
8+
entrypoint:
9+
- sh
10+
- -c
11+
- ./gradlew shadowJar
412
postgres:
513
environment:
614
- POSTGRES_DB=keycloak
715
- POSTGRES_USER=keycloak
816
- POSTGRES_PASSWORD=password
9-
image: postgres:16
17+
image: docker.io/postgres:16
1018
volumes:
1119
- postgres:/var/lib/postgresql
1220
openldap:
13-
image: bitnami/openldap:2.6
21+
image: docker.io/bitnami/openldap:2.6
1422
environment:
1523
LDAP_PORT_NUMBER: 389
1624
keycloak:
1725
image: quay.io/keycloak/keycloak:26.1.4
1826
command: --verbose start-dev --features=preview
1927
depends_on:
28+
- build-custom-user-federation
2029
- postgres
2130
- openldap
2231
environment:
@@ -33,14 +42,14 @@ services:
3342
- KC_FEATURES=preview
3443
- QUARKUS_HTTP_ACCESS_LOG_ENABLED=true
3544
- QUARKUS_HTTP_RECORD_REQUEST_START_TIME=true
36-
# Enable for remote java debugging
37-
# - DEBUG=true
38-
# - DEBUG_PORT=*:8787
45+
# Enable for remote java debugging
46+
# - DEBUG=true
47+
# - DEBUG_PORT=*:8787
3948
ports:
4049
- "8080:8080"
41-
# Enable for remote java debugging
42-
# - "8787:8787"
50+
# Enable for remote java debugging
51+
# - "8787:8787"
4352
volumes:
44-
# Make the custom-user-federation-example extension available to Keycloak. The :z option is required and tells Docker that the volume content will be shared between containers.
45-
- ./custom-user-federation-example/build/libs/custom-user-federation-example-all.jar:/opt/keycloak/providers/custom-user-federation-example-all.jar:z
53+
# Make the custom-user-federation-example extension available to Keycloak. The :z option is required and tells Docker that the volume content will be shared between containers.
54+
- ./custom-user-federation-example/build/libs/:/opt/keycloak/providers/:z
4655
- ./provider/misc:/opt/keycloak/misc:z

makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
22
GOOS?=darwin
33
GOARCH?=arm64
4+
CONTAINER_RUNTIME?=docker
45

56
MAKEFLAGS += --silent
67

@@ -27,19 +28,19 @@ run-debug:
2728
echo "Starting delve debugger listening on port 127.0.0.1:58772"
2829
dlv exec --listen=:58772 --accept-multiclient --headless "./terraform-provider-keycloak_$(VERSION)" -- -debug
2930

30-
local: deps user-federation-example
31+
local: deps custom-user-federation-example/build/libs/custom-user-federation-example-all.jar
3132
echo "Starting local Keycloak environment"
32-
docker compose up --build -d
33+
$(CONTAINER_RUNTIME) compose up --build --detach
3334
./scripts/wait-for-local-keycloak.sh
3435
./scripts/create-terraform-client.sh
3536

3637
local-stop:
3738
echo "Stopping local Keycloak environment"
38-
docker compose stop
39+
$(CONTAINER_RUNTIME) compose stop
3940

4041
local-down:
4142
echo "Destroying local Keycloak environment"
42-
docker compose down
43+
$(CONTAINER_RUNTIME) compose down
4344

4445
deps:
4546
./scripts/check-deps.sh
@@ -60,5 +61,5 @@ fmtcheck:
6061
vet:
6162
go vet ./...
6263

63-
user-federation-example:
64+
custom-user-federation-example/build/libs/custom-user-federation-example-all.jar:
6465
cd custom-user-federation-example && ./gradlew shadowJar

0 commit comments

Comments
 (0)