Skip to content

Aren't there secure issues since we expose 6379:6379 #35

Open
@FingerLiu

Description

@FingerLiu

https://github.com/realpython/dockerizing-django/blob/master/docker-compose.yml
wrote

redis:
  restart: always
  build: ./redis
  ports:
    - "6379:6379"

I think this may expose 6379 to the whole internet?
Although in production.yml changed to

ports:
  - "6379"

it expose a random port to the whole internet

And from compose file reference https://docs.docker.com/compose/compose-file/#/ports
there is a format

ports:
   - "127.0.0.1:8001:8001"

Would this be safer? Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions