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