wait-for-it icon indicating copy to clipboard operation
wait-for-it copied to clipboard

PORT env variable will be overridden

Open qiankunxie opened this issue 7 years ago • 2 comments

In my use case:

  web:
    build: .
    command: ./wait-for-it.sh mongo:27017 -t 0 -- nodemon server.js
    restart: always
    environment:
      - PORT=8096
    volumes:
      - .:/code
    ports:
      - "8096:8096"
    links:
      - mongo

  mongo:
    image: 'mongo:3.2.1'
    ports:
      - '27017:27017'
    volumes:
      - './data/db:/data/db'

I have environment variable named PORT which will be overridden by mongo's port when running wait-for-it bash. My solution is to change PORT variable in bash to _PORT to make it looks more private.

qiankunxie avatar Oct 09 '17 15:10 qiankunxie

+1

enver avatar Oct 21 '17 15:10 enver

I also spent an hour debugging because of this. Not sure if this has been fixed otherwise I'm happy to make a pull request.

edit: Yes it is, by #44 and merged in.

Johnsel avatar May 05 '19 03:05 Johnsel