Hi, i'm trying to run redis server in docker behind traefik.
This is my redis docker-compose configuration
version: "3"
services:
redis:
image: redis:latest
restart: always
volumes:
- redis_db:/data
- ./redis.conf:/usr/local/etc/redis/redis.conf
networks:
- traefik-proxy
- redis_db
environment:
- REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
labels:
- "traefik.enable=true"
# routers
- "traefik.tcp.routers.redis.rule=HostSNI(`*`)"
- "traefik.tcp.routers.redis.entryPoints=redis"
- "traefik.tcp.routers.redis.service=redis"
# services (needed for TCP)
- "traefik.tcp.services.redis.loadbalancer.server.port=6379"
volumes:
redis_db:
networks:
traefik-proxy:
external: true
redis_db:
Entrypoint for redis
redis:
address: ":6379"
This lines i changed in redis.conf
requirepass strong_password
bind * -::*
In admin page everything looks great
I'm trying to connect from my pc
redis-cli -h redis.example.com
redis-cli -h redis.example.com -a strong_password
I also tried to enable tls and change SNI name
redis-cli -u redis://redis.example.com:6379 --tls --sni redis.example.com
But always i can see only this:
Could not connect to Redis at redis.example.com:6379: Connection refused
I have A
DNS record redis.example.com (if it's suddenly important)
I hope you can help me figure out what I'm doing wrong