Worker cannot connect to server before deadline

This is my current docker composer yml file.
services:
app:
build:
context: .
dockerfile: Dockerfile
environment:
- TEMPORAL_ADDRESS=127.0.0.1:7233
volumes:
- .:/app
depends_on:
- temporal
networks:
- temporal-network
command: [“npm”, “run”, “start:worker”] # Ensure the correct start command is used
restart: always # Restart the app if it crashes for any reason

postgresql:
container_name: temporal-postgresql
environment:
POSTGRES_PASSWORD: temporal
POSTGRES_USER: temporal
image: postgres:${POSTGRESQL_VERSION}
networks:
- temporal-network
ports:
- 5432:5432
volumes:
- /var/lib/postgresql/data
temporal:
container_name: temporal
depends_on:
- postgresql
environment:
- DB=postgres12
- DB_PORT=5432
- POSTGRES_USER=temporal
- POSTGRES_PWD=temporal
- POSTGRES_SEEDS=postgresql
- BIND_ON_IP=0.0.0.0
- TEMPORAL_BROADCAST_ADDRESS=127.0.0.1
image: temporalio/auto-setup:${TEMPORAL_VERSION}
networks:
- temporal-network
ports:
- 7233:7233
volumes:
- ./dynamicconfig:/etc/temporal/config/dynamicconfig
healthcheck:
test: [“CMD”, “nc”, “-z”, “localhost”, “7233”]
interval: 10s
timeout: 5s
retries: 5
temporal-admin-tools:
container_name: temporal-admin-tools
depends_on:
- temporal
environment:
- TEMPORAL_ADDRESS=temporal:7233
- TEMPORAL_CLI_ADDRESS=temporal:7233
image: temporalio/admin-tools:${TEMPORAL_ADMINTOOLS_VERSION}
networks:
- temporal-network
stdin_open: true
tty: true
temporal-ui:
container_name: temporal-ui
depends_on:
- temporal
environment:
- TEMPORAL_ADDRESS=temporal:7233
- TEMPORAL_CORS_ORIGINS=http://localhost:3000
image: temporalio/ui:${TEMPORAL_UI_VERSION}
networks:
- temporal-network
ports:
- 8080:8080
networks:
temporal-network:
driver: bridge
name: temporal-network

When I run with docker, the temporal server works on port 7233 correctly.
When I check with telnet 127.0.0.1 7233, I can see it is working.
But in the console, I can see this issue log.

Worker error: Error: Failed to connect before the deadline
app-1 | at checkState (/node_modules/@grpc/grpc-js/src/client.ts:177:18)
app-1 | at Timeout._onTimeout (/node_modules/@grpc/grpc-js/src/internal-channel.ts:826:9)
app-1 | at listOnTimeout (node:internal/timers:581:17)
app-1 | at process.processTimers (node:internal/timers:519:7)

I’ve tried everything but not sure how to solve this. My environment is Windows.
Please let me know how to solve this.

  • TEMPORAL_ADDRESS=127.0.0.1:7233

have you tried not using 127.0.0.1 but host.docker.internal instead?