Support additional args for `command` defined in docker-compose.yml for rasa service

Hi, Hope you’re doing well! I’m trying to deploy my bot on production. For that, I decided to migrate everything to docker. However, as I have a custom actions server using django, I need to use a docker compose as state in the documentation here. The problem is that, when I define the docker-compose file, in the command section , I need to call run together with some specific arguments from the cli. Here is what I mean:

version: '3.0'
 image: rasa/rasa:latest-full
   - 5005:5005
   - ./:/app
  - run --model  models/20190919-122829.tar.gz --endpoints endpoints.yml --enable-api --debug

However this throw this invalid argument choice exception:

rasa: error: invalid choice: 'run --model  models/20190919-122829.tar.gz --endpoints endpoints.yml --enable-api --debug' (choose from 'init', 'run', 'shell', 'train', 'interactive', 'test', 'visualize', 'data', 'x')

Is someone already encountered this problem when using rasa docker image?

Thanks in advance for your reply.

Can you try rather

command: >
  run --model  models/20190919-122829.tar.gz --endpoints endpoints.yml --enable-api --debug
1 Like

thanks @erohmensing. It works with that.

i dont understand why this works. Could you elaborate a little?

Thanks so much for the solution, I’ve been trying to make this work a couple of days now. I am also curious to know as to why this works. Also, may I suggest a clarification in the docs?

It’s more of an issue of understanding how providing commands in docker-compose works rather than anything specific. Using > makes everything in the next chunk be read as a string, whereas putting it with a - at the start makes it the first element of a list or arguments, passing the entire run --model .... as arg1. See here for more info: docker-compose cheatsheet – here it would be the equivalent of putting in run --model models/ ... as bundle.