我正在码头化rasa应用程序,Dockerfile
是
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"]
entrypoint.sh
的内容是
#!/bin/sh
exec "$@"
并且requirements.txt
文件具有
rasa==1.10.14
我在rasa init
目录内的docker外部使用src
命令启动了一个rasa应用程序,并将其全部复制到了docker。
现在,当我使用运行rasa时
docker build -t image .
docker run -it image rasa run
出现以下错误
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'
...
在docker外部运行rasa运行正常。