Problem solved by @JaredSmith in the comments of OP (sept. 2023).
@JaredSmith:
are you installing node dependencies directly in the docker container or on something else and then copying them over? Because the bcrypt package uses node-gyp to run C++ code and that's architecture-dependent: if you compile for say, Apple silicon and then try to run that code in a x64 docker image you'll get a segfault which could explain your problem. ...if you are copying over the node_modules folder, either directly or as part of your project directory, try stripping them out and running npm i (or yarn or whatever you're using) in the container instead.
@tguichaoua:
That's it! I was using the node_module from the host system.