源代码: https://github.com/ltoddy/ltoddy.github.io/tree/master/app
我租的服务器公网ip是116.85.42.182,你自己部署的时候请换成自己的公网ip!!!
最近云服务提供商再打价格战,福利多多,前两天就在滴滴云上花了0.9元租了个服务器,还是SSD(超值)!
去租云服务,然后他会让你选择你要安装的系统,我用的是ubuntu16.04,因为ubuntu我还是比较熟悉的.
买完服务器之后,你会得到一个公网ip,你可以通过ssh命令连接上你的服务器.
ssh dc2-user@116.85.42.182
顺便提一句,滴滴云给你创建的账户叫”dc2-user”,你需要自己设置root的密码.
![](https://img.vim-cn.com/be/6285cd4ec8d5a5560d98a72edc36210ff2ec04.jpg)
然后安装docker:
sudo apt-get install docker.io
演示一个最小的sanic-demo,来部署一下.
.
├── app.py
├── Dockerfile
└── templates
└── index.html
1 directory, 3 files
这是项目树.
app.py
import os
from sanic import Sanic
fro