Hello World with Mojolicious in Docker
Tiny experiment to show "Hello World" with Mojolicious in Docker.
Hello World
Taken from the Mojolicious Tutorial
examples/docker-mojolicious-hello-world/demo.pl
#!/usr/bin/env perl use Mojolicious::Lite -signatures; get '/' => sub ($c) { $c->render(text => 'Hello World!'); }; app->start;
Dockerfile
examples/docker-mojolicious-hello-world/Dockerfile
FROM perl:5.32 RUN cpanm Mojolicious WORKDIR /opt COPY demo.pl . CMD ["perl", "demo.pl", "daemon"]
Build the Docker image
$ docker build -t perldemo .
Run the Docker container
$ docker run --rm -p3000:3000 perldemo
Published on 2020-10-06
If you have any comments or questions, feel free to post them on the source of this page in GitHub. Source on GitHub.
Comment on this post