I am getting this error `The container is not listening in the TCP address 10.0.0.1:3000` but when t

I am getting this error The container is not listening in the TCP address 10.0.0.1:3000 but when the docker image is running it is listening on port 3000 hence the server log [2025-06-26 18:14:25] INFO WEBrick::HTTPServer#start: pid=188 port=3000

This is my code
import { Container, getContainer } from "@cloudflare/containers"

export class MyContainer extends Container {
    defaultPort = 3000
    sleepAfter = "1h"
    envVars = {
        DB_HOST: this.env.DB_HOST,
        DB_USERNAME: this.env.DB_USERNAME,
        DB_PASSWORD: this.env.DB_PASSWORD,
        DB_DATABASE: this.env.DB_DATABASE,
    }
}

export default {
    async fetch(request: Request, env: Env): Promise<Response> {
        const container = getContainer(env.MY_CONTAINER)
        return container.fetch(request)
    },
}


What should I try?
Was this page helpful?