作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
您好,我正在尝试使用Dockerfile运行我的抓scrap蜘蛛的CMD。我已将路径设置到包含scrapy scrapy.cfg文件夹和CMD scrapy爬网属性的文件夹,以启动蜘蛛程序
当我运行docker-compose up时返回错误
Scrapy 1.5.0 - no active project
web_1 |
web_1 | Unknown command: crawl
web_1 |
web_1 | Use "scrapy" to see available commands
FROM ubuntu:18.04
FROM python:3.6-onbuild
RUN apt-get update &&apt-get upgrade -y&& apt-get install python-pip -y
RUN pip install --upgrade pip
RUN pip install scrapy
ADD . /scrapy_estate/tutorial
WORKDIR /scrapy_estate/tutorial
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 80
CMD scrapy crawl estate
spider
├── CreateDB.sql
├── docker-compose.yml
├── Dockerfile
├── initdb
│ └── init.sql
├── init.sql
├── npm-debug.log
├── requirements.txt
└── scrapy_estate
└── tutorial
├── scrapy.cfg
└── tutorial
├── __init__.py
├── items.py
├── middlewares.py
├── pipelines.py
├── __pycache__
│ ├── __init__.cpython-36.pyc
│ ├── items.cpython-36.pyc
│ ├── middlewares.cpython-36.pyc
│ ├── pipelines.cpython-36.pyc
│ └── settings.cpython-36.pyc
├── settings.py
└── spiders
├── __init__.py
├── __pycache__
│ ├── __init__.cpython-36.pyc
│ └── real_estate_spider.cpython-36.pyc
└── real_estate_spider.py
2to3 __pycache__ docker-compose.yml.save init.sql
pip pydoc3.6 python3.6 requirements.txt tkconch
2to3-3.6 automat-visualize easy_install initdb
pip3 pyhtmlizer python3.6-config scrapy trial
CreateDB.sql cftp easy_install-3.6 items.py
pip3.6 python python3.6m scrapy_estate twist
Dockerfile ckeygen idle mailmail
pipelines.py python-config python3.6m-config settings.py twistd
Dockerfile.save conch idle3 middlewares.py
pydoc python3 pyvenv spiders wheel
__init__.py docker-compose.yml idle3.6 npm-debug.log
pydoc3 python3-config pyvenv-3.6 splash
最佳答案
CMD ["scrapy", "crawl", "estate"]
/bin/sh -c
中执行:
FROM python:3.6-onbuild
RUN apt-get update &&apt-get upgrade -y&& apt-get install python-pip -y
RUN pip install --upgrade pip
RUN pip install scrapy
ADD . /scrapy_estate/tutorial
WORKDIR /scrapy_estate/tutorial
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 80
CMD scrapy crawl estate
关于python - Dockerfile scrapy未知命令:爬网,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51664657/
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,
我是一名优秀的程序员,十分优秀!