Set password on mongodb when using docker

I am using rocketchat in a docker container using the standard yml script. Since I want to access the mongodb from another PC I would like to secure the mongodb. I found this snippet to set a password for the mongodb

mongo-container:
  image: mongo:3.4.2
  environment:
      # provide your credentials here
      - MONGO_INITDB_ROOT_USERNAME=root
      - MONGO_INITDB_ROOT_PASSWORD=rootPassXXX
  ports:
    - "27017:27017"
  volumes:

But how do I tell rocketchat in the yml file to use this credentials?

Thx

Stephan