We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
首先要购买好云服务器
然后打开terminal
ssh root@45.76.222.131
terminal会提示输入密码,直接输入收到的密码就好。
接着就要输入以下的命令了。
生成一个ssh key
ssh-keygen
显示公钥
cat ~/.ssh/id_rsa.pub
把生成的公钥放到GitHub上面
接着回来搭建基本的开发环境
安装vim
apt-get install -y vim git
安装docker
curl -SsL https://get.docker.com | sh
查看docker中的容器
docker ps -a
docker中安装node6.8
docker pull node:6.8
docker中安装mongodb:3.0
docker pull mongo:3.0
docker运行node
docker run -itd -v /root:/root --name node --net=host node:6.8 bash
进入docker
docker exec -it node bash
从GitHub克隆过来自己写好的网页应用
git clone git@github.com:zhuanyongxigua/notepad-online.git
列出所有
ls -all
出容器(另开一个terminal重新进)运行mongodb
docker run -itd --name mgo --net=host mongo:3.0
然后就可以cd到克隆过来的文件里面使用npm install并npm start了
npm install
npm start
如果运行出错,需要停掉程序
docker stop node
这里面的node就是上面创建的那个,因为上面创建的时候的name规定的是node
改好错之后就继续运行node
docker start node
如果需要向mongodb post数据
curl -i -H "Content-Type:application/json" -XPOST -d '这里是JSON数据' url
如果需要移除容器,需要先把容器停下来,在移除
docker stop node docker rm node //node就是之前开启的容器的名称
博客:https://zhuanyongxigua.github.io/
The text was updated successfully, but these errors were encountered:
No branches or pull requests
首先要购买好云服务器
然后打开terminal
terminal会提示输入密码,直接输入收到的密码就好。
接着就要输入以下的命令了。
生成一个ssh key
显示公钥
把生成的公钥放到GitHub上面
接着回来搭建基本的开发环境
安装vim
安装docker
查看docker中的容器
docker中安装node6.8
docker中安装mongodb:3.0
docker运行node
进入docker
从GitHub克隆过来自己写好的网页应用
列出所有
出容器(另开一个terminal重新进)运行mongodb
然后就可以cd到克隆过来的文件里面使用
npm install
并npm start
了如果运行出错,需要停掉程序
这里面的node就是上面创建的那个,因为上面创建的时候的name规定的是node
改好错之后就继续运行node
如果需要向mongodb post数据
如果需要移除容器,需要先把容器停下来,在移除
博客:https://zhuanyongxigua.github.io/
The text was updated successfully, but these errors were encountered: