"Cannot destructure property 'client' of 'db.config.connection' as it is undefined" when deployed in cPanel shared hosting

I just solved this problem.
I use docker compose outside of project and build.
The Dockerfile in project COPY path have to change.
Because my build context in docker compose is “.”
so Dockerfile code “COPY . .”,now need to use “COPY ./backend .” *backend is my,otherwise your code is not in correct folder.