Reputation: 11
I am getting connection time out error
description:
i am running node js api in docker container and mongodb is running on ec2 instnace with 3 node cluster and attached network load balancer and while running the nodejs api with npm the database is connecting and working fine and while when i ran the same code in docker container the database is not connecting and getting "connection to 15.200.165.69:27017 timed out" error
below is my docker file :
FROM node-11-alphine RUN mkdir -p /app WORKDIR /app COPY package.json /app RUN npm install COPY . /app EXPOSE 3001 CMD [ "node", "src/app.js" ]
Upvotes: 0
Views: 290
Reputation: 11
Issue is resolved
I expose the multiple ports in docker file for my requirement i expose both 3001 and 27017 ports
Upvotes: 0