Reputation: 155
I am building an authentication server, for storing the user access tokens and keep track of them i want to use redis.
I have successfully created and deployed a little nodejs app and wrapped it up into a a docker container that only returns the tokens. Then I pushed it to an ECR repo in AWS and created a task that runs and EC2 instance that works perfectly.
So far so good. The problem comes when I try to connect to the cluster I created. I am using this nodejs redis module, that works fine.
I have changed the VPC so all clusters and instances where under the same Network configuration. Maybe this is the point where I messed up because I'm not an expert in deploying and even less in network security groups.
Also I have successfully accessed redis cluster from another EC2 instance (not a docker container, just an ubuntu machine) under the same VPC with the same code snippet, so the code is not the problem.
So according with my test, the problem is not in the VPC, neither the code, so anyone knows what am I missing? Maybe something related to the Dockerfile connections?
I will show here all the configuration I think is needed:
Dockerfile
FROM node:8-alpine
MAINTAINER Sergio Faya Fernandez <[email protected]>
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . .
RUN npm install
EXPOSE 3000
CMD [ "npm", "start" ]
Upvotes: 1
Views: 3234
Reputation: 155
Nevermind, just found that in my EC2 container I was only accepting http, I changed it to accept all and now it works fine.
Upvotes: 1