I have two apps running on fly:
- A redis app that I created following this guide
- And a node app that I created using a custom
Dockerfile
They are both part of the same organization: “personal”.
The node app doesn’t seem to be able to connect to the redis one. This is the error I get
errno: -3008,
2022-06-21T11:56:20Z [info] code: 'ENOTFOUND',
2022-06-21T11:56:20Z [info] syscall: 'getaddrinfo',
2022-06-21T11:56:20Z [info] hostname: 'redis-staging.internal'
2022-06-21T11:56:20Z [info]}
2022-06-21T11:57:29Z [info]Error: getaddrinfo ENOTFOUND redis-staging.internal
2022-06-21T11:57:29Z [info] at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26)
I read through a few other questions that people have asked and I also changed the family
of my [node redis client](https://www.npmjs.com/package/redis)
return redis.createClient({
url: process.env.REDIS_URL,
socket: {
family: 6
}
})
This is the fly.toml
file used to generate the Redis app
app = "redis-staging"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[build]
image = "flyio/redis:6.2.6"
[env]
[experimental]
allowed_public_ports = []
auto_rollback = true
[[services]]
[[mounts]]
destination = "/data"
source = "redis_server"
This is the Dockerfile
I generated the node app with
FROM node:16.13.0-alpine3.11
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --pure-lockfile
COPY . .
EXPOSE 8080
RUN yarn run build
CMD ["yarn", "start"]
I set the REDIS_URL
secret using the command flyctl secrets set REDIS_URL=redis://default:myverysecretpassword@redis-staging.internal:6379 -a my-node-app
What could be going wrong?