docker: use the system dns for app containers

take 2 after failed attempt with 92bce26e22

this makes the dashboard domain resolve internally to nginx

can test with `getent ahosts my.domain.com` inside the container.
This commit is contained in:
Girish Ramakrishnan
2024-09-11 17:41:44 +02:00
parent 63457d2de4
commit 1b5fee233e
2 changed files with 2 additions and 5 deletions

View File

@@ -373,10 +373,7 @@ async function createSubcontainer(app, name, cmd, options) {
if (isAppContainer) {
containerOptions.Hostname = app.id;
containerOptions.HostConfig.NetworkMode = 'cloudron'; // user defined bridge network
// use unbound for app DNS resolution. this is a workaround for the requirement that OIDC server name has to resolve to
// public IP somehow skipping any /etc/hosts entries
containerOptions.HostConfig.Dns = ['172.18.0.1'];
containerOptions.HostConfig.DnsSearch = ['.'];
containerOptions.HostConfig.ExtraHosts = [ `${dashboardFqdn}:172.18.0.1` ];
containerOptions.NetworkingConfig = {
EndpointsConfig: {