Can I use DNS or other means to determine that I am running on gomix?


I need to configure differently depending on whether I am on gomix or a local host.

I’m currently depending on PROJECT_NAME set in the environment. That is probably good enough. But wondering if there is a better way.

I tried to use DNS to see if it would resolve to the right domain, but the hostname I get is 73ed16d4aec2 and DNS resolve of followed by reverse DNS lookup of the resulting IP address gives `’ which I guess is where my container is being hosted.

Code, for reference:

new Promise( (resolve,reject) => dns.lookup('', (err,addresses,family) => resolve(addresses)))
    .then((address) =>{console.log(address);return address})
    .then( (address) => new Promise(( resolve, reject) => dns.reverse(address, (err, hostnames) => resolve(hostnames)))) 
    .then((address) =>{console.log( address);return address})

Gives this result

[ '' ]

Config code is

if (process.env.PROJECT_NAME ) {
  devServer = 'webpack-dev-server/client?https://' + process.env.PROJECT_NAME + '';
} else {
  devServer = 'webpack-dev-server/client?https://localhost:3000'



Hi Mike,

sorry if this went out of our radar! Yes, you can use process.env.INSIDE_DOCKER. We didn’t document it because this is likely to change to something more informative, like INSIDE_GOMIX… but for now you can use it :slight_smile: