mojolicious 是一个perl的web 框架,以下是一个简单的试用
安装
- cli
curl -L https://cpanmin.us | perl - -M https://cpan.metacpan.org -n Mojolicious
- 或者
cpan install Mojolicious::Lite
简单demo
- app.pl
use Mojolicious::Lite;
get '/' => {text => 'I ♥ Mojolicious!'};
app->start;
- dockerfile
FROM perl:5.26
RUN cpan install Mojolicious::Lite
&& mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY app.pl /usr/src/app/
ENTRYPOINT [ "perl","/usr/src/app/app.pl","daemon","-m","production","-l","http://*:8080" ]
参考资料
https://mojolicious.org/
https://github.com/rongfengliang/mojolicious-learning