Skip sorry but this is not a solution.
@1990eam the linked thread has rarely anything to do with your issues. It’s not even about a docker installation.
As per Command "rails c" failes with database error · Issue #412 · zammad/zammad-docker-compose · GitHub
please consult the documentation on how to actually execute rails commands in a docker environment correctly:
Install with Docker Compose — Zammad System Documentation documentation