【发布时间】:2020-01-21 09:49:31
【问题描述】:
我想在 Linux 上的 Azure 应用服务(容器的 Web 应用)上使用 scrapinghub/splash 容器。
但是deploy上的docker run命令会随机改变容器端的绑定端口(见下面的日志,8961端口是自动分配的,这个数字每次部署都不一样)
2020-01-21 08:56:47.494 INFO - docker run -d -p 8961:8050 --name b2scraper-splash_3_d89ce1f2 -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITES_PORT=8050 -e WEBSITE_SITE_NAME =b2scraper-splash -e WEBSITE_AUTH_ENABLED=False -e PORT=8050 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=b2scraper-splash.azurewebsites.net -e WEBSITE_INSTANCE_ID=5446f93a2cbcb25300f091395c54ce738773ce47489c2818322ffabbc23e3413 scrapinghub/splash:latest 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" --disable-private-mode --port 8050
可以使用 WEBSITES_PORT 更改主机端口绑定,但似乎无法更改容器端。
有没有办法修复容器端端口绑定,如 -p 8050:80 或 -p 8050:443 的 docker run 命令?
例如可以在 Azure Container Instances 上使用容器,而无需更改服务端口 8050。
【问题讨论】:
标签: python docker scrapy splash-screen azure-web-app-service