Open Redis for Client with Docker

Allow to access all IP addresses in the server. to by modifying redis.conf

# bind
# protected-mode yes
protected-mode no
FROM redis
RUN mkdir /redis_log

COPY redis.conf /usr/local/etc/redis/redis.conf
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
import * as redis from "redis";
const client = redis.createClient("redis://redis_db");

client.on("error", function (error) {

client.set("key", "value", redis.print);
client.get("key", redis.print);
  • redis_db is redis container name
Reply: OK
Reply: value

Leave a Reply

Your email address will not be published.