When running Docker images on Render, there is no need for the docker run part. The Render platform essentially does this for you. I think you would only need to have start-dev as your dockerCommand in the render.yaml. You would also need to define the KEYCLOAK_ADMIN and KEYCLOAK_ADMIN_PASSWORD as environment variables as they are being used to start the Docker container if you run it locally.
I was able to run keycloack as docker container with these files:
-----Dockerfile------
FROM Quay
EXPOSE 8080
ENTRYPOINT [“/opt/keycloak/bin/kc.sh”]
CMD [“start-dev”]
------render.yaml------
services:
A Docker web service
type: web
name: keycloack
env: docker
region: frankfurt # optional (defaults to oregon)
plan: free # optional (defaults to starter instance type)
healthCheckPath: /healthz
The output message of the conole is: " Running the server in development mode. DO NOT use this configuration in production",but the DEPLOY FAILED with “Timed out after waiting for internal health check to return a successful response code at:…”
I followed your suggestion and I was able to DEPLOY keycloack , the service is LIVE.
BUT when i hit the url https://keycloack-booe.onrender.com i receive a HTTP ERROR 502.
This could be the problem???
" RUN keytool -genkeypair -storepass password -storetype PKCS12 -keyalg RSA -keysize 2048 -dname “CN=server” -alias server -ext “SAN:c=DNS:localhost,IP:0.0.0.0” -keystore "
It’s hard to say at this point, a 502 response can happen for a number of reasons. The RUN keytool the command isn’t failing because your service would build and deploy.
I think it might be best if you open a ticket directly with us so we can discuss this further in private.
Was a solution ever found for this problem? I am interested in deploying keycloak on render.com as well.
Could the problem be related to the disk/memory requirements of running the container? Found this thread, but it is slightly outdated. But if true, the free tier won’t work :/.
Also, is your instance of postgres running at the time of deployment? if not, would putting the database before the keycloak webservice in render.yaml, similarly to how it is done in some of the quickstart guides. Also, if you are using the native postgres on render, the connection string is for internal connections is formatted differently than in your latest version of the Dockerfile, as per the render docs.
I believe the 502 issue was related to Keycloak running on 2 ports which will have issues with our port detection. The solution was for the port which is to be exposed through our proxy to the public internet, as an PORT environment variable. You should see logs of which port Keycloak is using:
[io.quarkus] (main) Keycloak 21.1.1 on JVM (powered by Quarkus 2.13.7.Final) started in 150.390s. Listening on: https://0.0.0.0:8443
You need to add 8443 is the PORT environment variable.
As for the full solution to get this working Macros will need to provide this.