Rasa Crash! while using MongoDB as Tracker Store

I tried to add MongoDB as Tracker Store by following official doc:
http://rasa.com/docs/rasa/user-guide/running-rasa-with-docker/ Somehow rasa crashed!!

Steps:

  1. ~$ docker -v && docker-compose -v

    Docker version 18.09.6, build 481bc77 docker-compose version 1.24.0, build 0aa59064

  2. ~$ mkdir rasa && cd “$_”

  3. ~/rasa$ docker run -v $(pwd):/app rasa/rasa init --no-prompt

  4. ~/rasa$ docker run -it -v $(pwd):/app rasa/rasa shell

    Bot loaded. Type a message and press enter (use ‘/stop’ to exit): Your input → hello
    Hey! How are you? Your input → sad
    Here is something to cheer you up: Image: https://i.imgur.com/nGF1K8f.jpg Did that help you? Your input →

Till here, everything works fine! Then I try to add a MongoDB as Tracker Store:

  1. Create a docker-compose.yml:
mongo:
  image: mongo
  environment:
    MONGO_INITDB_ROOT_USERNAME: rasa
    MONGO_INITDB_ROOT_PASSWORD: example
mongo-express:
  image: mongo-express
  ports:
    - 8081:8081
  environment:
    ME_CONFIG_MONGODB_ADMINUSERNAME: rasa
    ME_CONFIG_MONGODB_ADMINPASSWORD: example
  1. Modify endpoints.yml:\

tracker_store:
type: mongod
url: mongodb://localhost:27017
db: rasa
username: rasa
password: example

  1. ~/rasa$ docker compose up

    Then rasa CRASHED!! see log file:log.txt (14.2 KB)

rasa version: 1.0.1

Could someone help me, please?

I think you have to replace the localhost with mongo in your endpoints.yml or expose the port of the mongo container.