设置我们的Rasa / NLU容器,对吗?

时间:2018-12-18 14:40:46

标签: docker dockerfile rasa-nlu

我有这个文件Dockerfile.nlu

FROM chatbot/spacy:latest
WORKDIR /app
COPY nlu ./agent_nlu
RUN python –m rasa_nlu.train --config agent_nlu/config.yml --data agent_nlu/data/ --path agent_nlu/agent --fixed_model_name default

我得到以下错误:

]$ sudo docker build -t nlu:latest -f docker/Dockerfile.nlu .
Sending build context to Docker daemon  9.216kB
Step 1/4 : FROM chatbot/spacy:latest
 ---> 496dc6a38abb
Step 2/4 : WORKDIR /app
 ---> Using cache
 ---> 7f02012c8452
Step 3/4 : COPY nlu ./agent_nlu
COPY failed: stat /var/lib/docker/tmp/docker-builder363868051/nlu: no such file or directory

1 个答案:

答案 0 :(得分:1)

看起来Docker无法找到nlu目录。您确定它存在吗?您确定要从正确的目录执行命令吗?

但是您也不是完全不需要安装Rasa或没有安装它。您没有使用预构建的Rasa图像是有原因的吗? here与文档here一起可用。

这是一个从其repo中提取的功能齐全的Docker文件。

FROM python:3.6-slim

ENV RASA_NLU_DOCKER="YES" \
    RASA_NLU_HOME=/app \
    RASA_NLU_PYTHON_PACKAGES=/usr/local/lib/python3.6/dist-packages

# Run updates, install basics and cleanup
# - build-essential: Compile specific dependencies
# - git-core: Checkout git repos
RUN apt-get update -qq \
    && apt-get install -y --no-install-recommends build-essential git-core openssl libssl-dev libffi6 libffi-dev curl  \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR ${RASA_NLU_HOME}

COPY . ${RASA_NLU_HOME}

# use bash always
RUN rm /bin/sh && ln -s /bin/bash /bin/sh

RUN pip install -r alt_requirements/requirements_spacy_sklearn.txt

RUN pip install -e .

RUN pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_md-2.0.0/en_core_web_md-2.0.0.tar.gz --no-cache-dir > /dev/null \
    && python -m spacy link en_core_web_md en \
    && pip install https://github.com/explosion/spacy-models/releases/download/de_core_news_sm-2.0.0/de_core_news_sm-2.0.0.tar.gz --no-cache-dir > /dev/null \
    && python -m spacy link de_core_news_sm de

COPY sample_configs/config_spacy.yml ${RASA_NLU_HOME}/config.yml

VOLUME ["/app/projects", "/app/logs", "/app/data"]

EXPOSE 5000

ENTRYPOINT ["./entrypoint.sh"]
CMD ["start", "-c", "config.yml", "--path", "/app/projects"]