Closed nidkil closed 5 years ago
Never mind, my bad. should be:
version: '3.7'
services:
redis:
ports:
- "6380:6379"
The problem was not solved with the above change when used in conjunction with redis-commander
. I needed to change the port Redis was running on as well set ut as the exposed port. This is the working Docker Compose file.
version: '3.7'
services:
redis:
container_name: redis
hostname: redis
image: sameersbn/redis:4.0.9-2
entrypoint: /sbin/entrypoint.sh -- --port 6380
ports:
- "6380:6380"
expose:
- "6380"
volumes:
- type: volume
source: redis-data
target: /data
restart: always
redis-commander:
container_name: redis-commander
hostname: redis-commander
image: rediscommander/redis-commander:latest
restart: always
environment:
- REDIS_HOSTS=local:redis:6380
ports:
- "8082:8081"
volumes:
redis-data: {}
Hi,
I have tried to change the port using the provided
docker-compose.yml
file, but this does not work.This is the changed
docker-compose.yml
file:This is the node code I'm using to test it:
If I change the port back to
6379
in thedocker-compose.yml
file and the code then it works.Any ideas how to change the port?