Custom Provider - how to load in docker container?

I built some custom providers. They work fine. In my dev server i had to create a module.xml and activate the module in standalone.xml.
What‘s the best way to run the module in docker - I’d prefer some environment parameter to activate the module instead of changing the standalone.xml or standalone-ha.xml.
Mounting the module directory is already done.

I also tried deploying via the deployments directory, but that failed for my module while its fine for simpler things like themes.

We were able to get this to work by having the custom user provider project create a shadow jar. Then the shadow jar is placed by that project into the build directory where we create the Keycloak container. Finally, we use gradle to copy the jar into deployments like so:

dockerfile {
    from ('jboss/keycloak:10.0.2')
    copyFile('jars/keycloak-providers.jar', '/opt/jboss/keycloak/standalone/deployments')
}

You should also be able to specify those commands in your Dockerfile without gradle(the paths might not be quite right):

FROM jboss/keycloak:10.0.2

COPY jars/keycloak-providers.jar /opt/jboss/keycloak/standalone/deployments

Hey, thanks for reading.
I had tried to simply drop the jar into deployments (before looking at containers) which did end in a failed deployment. That’s why I switched to the module.xml approach.
Now looking at containers…
I’ll revalidate the deployments directory approach or as you call it shadow jar.

How do you access the deployment directory?

Mounting the module directory is already done.

Do you mean you mounted keycloak container instance to a local directory? How did you do that?

Sorry I didn’t answer your question, I just simply could not find anything even on the dockerhub the instructions was vague.

To add a custom provider extend the Keycloak image and add the provider to the /opt/jboss/keycloak/standalone/deployments/ directory.

Not sure how to access that deployment direcoty. Any help is appricated!!