I've deployed a docker image to an Azure Linux App Service which contains a node app. The app is failing to start properly because it can't connect to a Mongo version of Cosmo DB.
error: MongoError: failed to connect to server [***.documents.azure.com:10255] on first connect [MongoError: getaddrinfo EAI_AGAIN ***.documents.azure.com:10255]
I'm using mongoose and the following to connect:
mongoose.connect(process.env.MONGODB_URL, { useMongoClient: true });
Running the app in a container locally on my machine works. Is there something I'm missing? Some DNS/Firewall setting?
Dockerfile:
FROM mhart/alpine-node:latest
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
COPY package.json package-lock.json ./
RUN npm install --production
# Bundle app source
COPY . .
EXPOSE 4000
CMD [ "node", "main.js" ]