【发布时间】:2020-12-13 14:25:54
【问题描述】:
我编写了一个简单的烧瓶网络服务来使用 fastText 进行预测。我想把它们放进码头。我的 Dockerfile 是这样的:
FROM python:3
WORKDIR /app
COPY . .
RUN pip3 install -r requirements.txt
RUN git clone https://github.com/facebookresearch/fastText.git /tmp/fastText && \
rm -rf /tmp/fastText/.git* && \
mv /tmp/fastText/* / && \
cd / && \
make
CMD ["python", "app.py"]
requirements.txt
Flask==0.10.0
docker-compose.yml
version: "3.7"
services:
helloworld:
build:
context: ./
ports:
- 5000:5000
当我运行 docker-compose up 时,它会出现错误:
ModuleNotFoundError: No module named 'fasttext'
如何解决这个问题?
【问题讨论】:
-
尝试将 RUN pip3 install -r requirements.txt 改为 RUN pip install -r requirements.txt
标签: python docker flask fasttext