Cron job in one container cannot access database in another

Hiw fellows,

I have a repository [1] with a cron job defined with a database. I want to host it using docker-compose and populate rows using the database service name. I learned, I can use the service name as host in this use case. Python ORM library does not recognize this, though. The definition of host occurs in src/setup/ I can access the containarized database with command psql, but not the other container.

Any help is very appreciated.

[1] GitHub - brunolnetto/db-cron-docker: A dockerized cron task with database

Share your docker-compose.yml.