Hea*_*Qiu 6 heroku scrapy docker splash-js-render
我有一个使用splash的scrapy蜘蛛,该splash运行在Docker localhost:8050上以在渲染之前呈现JavaScript。我正在尝试在heroku上运行此程序,但不知道如何配置heroku以在运行我的Web之前启动docker运行闪屏:scrapy crawl abc dyno。非常感谢任何指导!
小智 6
从我的收集中,您期望:
docker
CLI和heroku
CLIdocker
CLI和heroku
CLIheroku container:login
docker tag scrapinghub/splash registry.heroku.com/<app-name>/web
docker push registry.heroku.com/<app-name>/web
heroku open -a <app-name>
。这应该允许您在此应用程序名称的Heroku主机上的端口8050上看到Splash UI。
$PORT
设置正确,因为EXPOSE
不遵守docker配置(https://devcenter.heroku.com/articles/container-registry-and-runtime#dockerfile-commands-and-runtime)<app-host-name>:8050
。Scrapy蜘蛛现在应该能够请求先前运行的Splash实例。运行在同样的问题上。最后,我在Heroku上成功部署了初始docker镜像。这是我的解决方案:我从github克隆了启动程序,并更改了Dockerfile。
CMD python3 / app / bin / splash --proxy-profiles-path / etc / splash / proxy-profiles --js-profiles-path / etc / splash / js-profiles --filters-path / etc / splash / filters- -lua-package-path /etc/splash/lua_modules/?.lua --port $ PORT
注意,我添加了--port = $ PORT选项。这只是侦听Heroku指定的端口,而不是默认端口(8050)
叉子的proyect这种变化的avaliable 在这里 你只需要建立泊坞窗图像,并将其推到Heroku的注册表,像你以前那样。您可以先在本地对其进行测试,但是在运行docker时必须传递环境变量“ PORT”
须藤码头运行-p 80:80 -e PORT = 80 mynewsplashimage
归档时间: |
|
查看次数: |
791 次 |
最近记录: |