You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deb http://mirrors.163.com/debian/ jessie main non-free contrib
deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib
cd node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux
ldd chrome | grep not
# libatk-bridge-2.0.so.0 => not found
# libpangocairo-1.0.so.0 => not found
# libpango-1.0.so.0 => not found
# libcairo.so.2 => not found
# libatspi.so.0 => not found
# libgtk-3.so.0 => not found
# libgdk-3.so.0 => not found
# libgdk_pixbuf-2.0.so.0 => not found
# 查找到缺少的so文件,同上反查询出安装包名
yum install atk pango at-spi2-atk gtk3
近期用 nuxt.js + nightmare 开发的爬虫工具,发布时部署 Linux 系统。由于 Linux 系统没有图像相关的 GUI 界面,需要安装一系列的依赖,所以才遇到坑。
CentOS 和 Ubuntu 系统都不一样的操作,遇到 docker 创建的各种坑(其实就是不熟悉),以及国内服务器 docker build 时下载速度慢,需要镜像更换等,从不会写 Dockerfile 到懂得使用 Docker 部署 nuxt.js 应用的过程,以下是一些操作记录。
puppeteer 镜像设置为国内
pm2
pm2 启动 nuxt 的方式
端口占用
Linux
MacOS
sudo npm 问题
防火墙端口
nightmare 和 centos
https://www.myfreax.com/how-to-install-google-chrome-web-browser-on-centos-8/
Ubuntu
segment-boneyard/nightmare#224
https://github.com/mitel/nightmare-docker/blob/master/Dockerfile
docker nuxt
https://hoody.tech/blog/detail/27
Ubuntu 安装最新版 nodejs
https://www.jianshu.com/p/e7605f75b767
Ubuntu 安装 docker
https://www.jianshu.com/p/80e3fd18a17e
docker 镜像源切换
输入
重启 docker
apt-get 镜像更换
其中 s@/deb.debian.org/@/mirrors.163.com/@g 表示将
deb.debian.org
全部替换为mirrors.163.com
的意思不写着行,直接系统 设置
sources.list
在 docker 内部不起作用,最会对当前系统执行有效sources.list
内容为:可以先考虑 备份原来的文件
mv /etc/apt/sources.list /etc/apt/sources.list.bak
Dockerfile
提出环境部分单独发布镜像
https://hub.docker.com/repository/docker/giscafer/nightmare
项目部署的dockerfile
单纯测试nightmare在linux上docker部署的话参考:Running Nightmare headlessly on Linux
The text was updated successfully, but these errors were encountered: