Closed schuettecarsten closed 5 months ago
Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.
Check which DNS server is used in the container.
DNS looks fine, there is no dns option in the docker-compose.yml, so I did not overwrite DNS settings.
root@dummi:/etc/docker# docker exec -ti unifi-app cat /etc/resolv.conf
search guest
nameserver 127.0.0.11
options ndots:0
root@dummi:/etc/docker# docker exec -ti unifi-app getent hosts unifi-db
172.23.0.2 unifi-db
Here is output of docker inspect internal
with details of the internal network:
[
{
"Name": "internal",
"Id": "f88f8303f92de85e729e111bbea2fc20aa45149d09888c48495b51f7fe3f1e7d",
"Created": "2024-03-22T06:56:21.447768207Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.23.0.0/16",
"Gateway": "172.23.0.1"
}
]
},
"Internal": true,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"18194943a40177b0dc3804883c4059fb333b36555a38d52f185a27e9c6371fcc": {
"Name": "unifi-app",
"EndpointID": "96343f96434bb0996f80912128dd5016a396fea331e4f3462d7e86291970b3dc",
"MacAddress": "02:42:ac:17:00:03",
"IPv4Address": "172.23.0.3/16",
"IPv6Address": ""
},
"7c6aa7fbc638f18e3f1f8af7d51349a9f77e74bf3a3abc593f0ee1d89d604965": {
"Name": "unifi-db",
"EndpointID": "b529243dd226e8cd6620b6676e1981d225cb7017fec6e63164ba8209bac3c8c2",
"MacAddress": "02:42:ac:17:00:02",
"IPv4Address": "172.23.0.2/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {
"com.docker.compose.network": "internal",
"com.docker.compose.project": "docker",
"com.docker.compose.version": "2.25.0"
}
}
]
If you remove your vlan network, will unifi connect to the database?
That's interesing. No, it does not.
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
This issue is locked due to inactivity
Is there an existing issue for this?
Current Behavior
I am using docker compose to deploy two containers: app and db. I also have two networks, one "macvlan" network and an "internal" network. The "app" container is attached to both networks and should be reachable from an public IP, e.g. 192.168.11.2, and then it should use the internal network to communicate with the mongodb container. Unfortunately, that does not work.
Expected Behavior
No response
Steps To Reproduce
Here are the relevant parts of the docker-compose.yml file:
system.properties:
server.log:
If I configure it that way, the app gets stuck on connecting to database. To fix it, I have to connect the unifi-db container to vlan1 network and assign a static IP from 192.168.11.0/24 subnet.
Environment
CPU architecture
arm64
Docker creation
Container logs