自从去年接触Cloud与SaaS以来,就一直想自己搞个什么东西。但之前的开发是基于AWS,没有美刀,就想在免费的Paas上牛刀小试了。
开始是GAE,可惜Google和ZF不对付,开始还能用用,后来干脆咯屁,所以不了了之。
后来又有了VMWare Cloud Foundry与DotCloud,感觉各有千秋。VMWare的Micro Cloud Foundry很是吸引我,但是Cloud Foundry的申请比较麻烦些,好不容易找了个时间把玩把玩,等不了VMWare的爷们了。说干就干,就拿DotCloud开刀。
对了,它的空间大小限制:
For the Free plan, database services default to 10 MB of disk, and 10 MB of RAM.
With the Pro plan, database services have 10 GB of disk, and 300 MB of RAM
>> 安装Command Line Interface
跟Amazon EC2一样,DotCloud也提供了一个CLI,用于平时的管理(呵呵,其实DotCloud本身就跑在了Amazon EC2上)。
不过DotCloud CLI是基于Linux的,在Windows上没有官方支持,汗!!幸好有好事者kalman Speier搞出一个Work Around,竟被DotCloud的同志们引用,更贴心的是,Kalman君还做一个安装包,不需配置过程,安装即可。感谢kalman Speier,否则我到此就要打道回府了。
https://github.com/speier/DotCloudWin
https://github.com/speier/DotCloudWin/downloads
>> 常用的DotCloud命令
--------------------------------------------------------------
positional arguments:
{info,status,stats,run,logs,versions,url,setup,list,rollback,alias,ssh,push,de
stroy,create,restart,history}
setup setup your api key
history display the last commands you ran
create create an application
push push your application
list list your applications
versions list the versions of your application
run run a remote command
logs read logs
alias bind a custom domain name to a service
destroy destroy your application
url display URL(s) of your application
info get information about your application or service
status check the status
stats display the HTTP stats of your service
rollback rollback your service to the previous pushed version
ssh open an SSH session
restart restart your service
optional arguments:
-h, --help show this help message and exit
-------------------------------------------------------------
最关键的就是create/push。前者用来创建一个新的应用,而后者就是用来更新的。
>> 创建一个新的应用
物理结构:
值得注意的是,需要在根目录添加一个配置文件dotcloud.yml.因为这个东西只是一个简单的static HTML应用,很容易:
dotcloud.yml:
--------------------------------------------
www:
type: static
--------------------------------------------
命令行与阉割后的结果:
D:\Piaoger\dotcloud>dotcloud create todolist
Created application "todolist"
D:\Piaoger\dotcloud>dotcloud push todolist
Deployment finished. Your application is available at the following URLs
www: http://todolist-piaoger.dotcloud.com/
>> 检查成果
点开http://todolist-piaoger.dotcloud.com/
呵呵,此路已通,终于可以开始我的JavaScript/HTML3/CSS3了。