I’ve created an image for my springboot app and added the following service to the docker-compose.yml file which I’ve included in my project:
When I run the file (docker-compose up), the temporal container always dies, and my app cannot make the connection to the server. When I remove my service above from the docker-compose.yml file, temporal runs.
Additionally, here is some code from my application where I build a temporal service:
WorkflowServiceStubsOptions options =
service = WorkflowServiceStubs.newInstance(options);
Not sure if that’ll help, but I’m putting in just in case.
How can I fix this? Any help is greatly appreciated. Thanks
WorkflowServiceStubsOptions look ok (setting the target to “temporal:7233”).
One thing you might be missing is
depends_on to wait for temporal service to start before staring up your app, for example:
Another thing to look into is your the logs when you run
docker compose up to see why your app startup is failing. One thing that can happen is that you compiled your app with one java version and then use a wrong version base image in Dockerfile, maybe check for that.
Here is simple Dockerfile that worked locally:
COPY target/dockerdemo-1.0.jar dockerdemo-1.0.jar
openjdk 11.0.11 2021-04-20
Image built with
docker build -t mydemos/dockerdemo .