Docker: Cannot assign requested address


I’m using docker container to host application in NodeJS which includes worker & workflow.
But when I start worker getting following error:

I have started temporal server using docker-compose file- docker-compose-postgres.yml from here: GitHub - temporalio/docker-compose: Temporal docker-compose files

I have not included any connection in worker.ts file.

Also, have mentioned network while running application container:
docker run -it --network=temporal-network --name helloworld helloworld

Is there any setting that we need to do when using docker images for applications?

Hi @nehapatil7199

I think that as the docker-compose exposes temporal as a service, you can connect to it by setting the address in your worker to temporal:7233, something like

const connection = await Connection.connect({
  address: "temporal:7233"

const worker = await Worker.create({

let me know if it works.

Tried with NativeConnection in worker. It worked.