Bananapi BPI-R4 - Docker

Greetings, everyone. I encountered a problem on Banana Pi BPI-R4 on version 24.10.0, I use Docker and when I open the link from app and Data Base, for some reason the application cannot access the database and there is an error
The database settings are invalid: dial tcp 172.19.0.2:5432: connect: connection refused

services:
db:
image: mariadb:latest
restart: always
command: --transaction-isolation=READ-COMMITTED
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=12345
- MYSQL_PASSWORD=1234
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud

redis:
image: redis:alpine
restart: always

app:
image: nextcloud
restart: always
ports:
- 8080:80
depends_on:
- redis
- db
volumes:
- /mnt/sda1/nextcloud:/var/www/html
environment:
- MYSQL_PASSWORD=
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db

volumes:
nextcloud:
db:

How this is an openwrt problem?

The question is specifically about openwrt or docker, I personally don’t care. Tests on other OSes like Ubuntu have shown that my app+db connections work, I'm trying to figure out what the problem is

You do not provide any useful context. In Openwrt and other oxes like fedora yyou have to expose ports manually.

ok, then tell me what else should I add to make the picture come together? This problem occurs with everything I try to run on openwrt, if it concerns docker

1 Like

Kind of use other oxes that worked.

Well, this is not a solution, I want to understand what the problem is. On this router, this is the most working system, if you fix this nuance ok.

1 Like

Can you connect to database? So you need to add firewall rule to let your new container to connect.

According to all the signs that I diagnosed app+db on the same network, they have addresses of the same range, that is, they are on the same network. At the same time, any connection to the database or application, for some reason unknown to me, does not happen. At the same time, the same docker compose or dockerfile worked smoothly on Ubuntu and I don’t understand where the reason is that it is a container on the same network, but auto connection, like the gitea example, does not happen