Skip to content

ValKey won't give up port 6379/tcp in a Docker Compose deployment #920

Discussion options

You must be logged in to vote

I think I know why it is like that
Here: https://github.com/valkey-io/valkey-container/blob/mainline/7.2/alpine/Dockerfile#L112
Here we expose the port 6379 as valkey runs by default on this one.
This is the inside view of the container hosting valkey on 6379 and you can bind it to some other port on the host something like

version: '3'

services:
  valkey:
    container_name: valkey
    hostname: valkey
    image: valkey/valkey:7.2.5
    volumes:
      - ./conf/valkey.conf:/etc/valkey/valkey.conf
      - ./data:/data
    command: valkey-server /etc/valkey/valkey.conf
    healthcheck:
      test: ["CMD-SHELL", "valkey-cli ping | grep PONG"]
      interval: 1s
      timeout: 3s
      retri…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by roshkhatri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants