Docker compose port mapping

后端 未结 4 1311
别跟我提以往
别跟我提以往 2020-12-13 01:56

I have a docker-compose yml file as in below

version: \'2\'
services:
  nodejs:
    build:
      context: .
      doc         


        
4条回答
  •  旧巷少年郎
    2020-12-13 02:23

    If you want to access redis from the host (127.0.0.1), you have to use the ports command.

    redis:
      build:
        context: .
        dockerfile: Dockerfile-redis
        ports:
        - "6379:6379"
    

提交回复
热议问题