I'm dockerizing rasa application and the Dockerfile
is
FROM python:3.7.6
RUN apt-get update && apt-get install -y --no-install-recommends build-essential curl
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY entrypoint.sh .
COPY src/ .
EXPOSE 5005
ENTRYPOINT ["/app/entrypoint.sh"]
The content of entrypoint.sh
is
#!/bin/sh
exec "$@"
and the requirements.txt
file has
rasa==1.10.14
I initiated a rasa application using rasa init
command outside docker inside src
directory and copied all to the docker.
Now when I run rasa using
docker build -t image .
docker run -it image rasa run
It gives the following error
2020-10-15 19:38:00 INFO root - Starting Rasa server on http://localhost:5005
2020-10-15 19:38:02 ERROR rasa.core.agent - Could not load model due to Failed to find module 'rasa.nlu.classifiers.fallback_classifier'.
No module named 'rasa.nlu.classifiers.fallback_classifier'.
Experienced exception while trying to serve
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/rasa/nlu/registry.py", line 173, in get_component_class
return class_from_module_path(component_name)
File "/usr/local/lib/python3.7/site-packages/rasa/utils/common.py", line 210, in class_from_module_path
m = importlib.import_module(module_name)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'rasa.nlu.classifiers.fallback_classifier'
...
Running the rasa outside docker is working fine.