So I managed to workaround the issue, and verified what I posted before is the issue: database.yml is in the wrong place. It should be in /opt/zammad/config
not only in /opt/zammad/config/database/
I copied the default database.yml file and mounted that in the docker template as so:
x-shared:
zammad-service: &zammad-service
environment: &zammad-environment
[..snip..]
volumes:
- ./tempdb.yml:/opt/zammad/config/database.yml
Restarted docker and problem solved. No more connection errors in log.
$ docker compose run --rm zammad-scheduler rails r "p ActiveRecord::Base.connection_pool.stat"
[+] Creating 3/3
✔ Container docker_zammad_zammad-memcached_1 Recreated 0.5s
✔ Container docker_zammad_zammad-redis_1 Recreated 0.3s
✔ Container docker_zammad_zammad-postgresql_1 Recreated 0.4s
[+] Running 3/3
✔ Container docker_zammad-zammad-memcached-1 Started 0.5s
✔ Container docker_zammad-zammad-postgresql-1 Started 0.4s
✔ Container docker_zammad-zammad-redis-1 Started 0.3s
I, [2024-05-17T10:53:21.527187 #1] INFO -- : ActionCable is using the redis instance at redis://zammad-redis:6379.
I, [2024-05-17T10:53:21.578017#1-6060] INFO -- : Using memcached as Rails cache store.
I, [2024-05-17T10:53:21.578302#1-6060] INFO -- : Using the Redis back end for Zammad's web socket session store.
{:size=>50, :connections=>0, :busy=>0, :dead=>0, :idle=>0, :waiting=>0, :checkout_timeout=>5.0}