Tekki / docker-mojolicious

:whale: Docker image for Mojolicious
Artistic License 2.0
14 stars 3 forks source link

What is Mojolicious?

Mojolicious is a real-time web framework and web development toolkit written in Perl.

The images are based on perl:5.40.0 and provide Mojolicious installed together with Cpanel::JSON::XS, DBI, EV, Future::AsyncAwait, IO::Socket::Socks, Net::SSLeay, IO::Socket::SSL, Net::DNS::Native, Role::Tiny, SQL::Abstract.

Supported tags and respective Dockerfile links

mariadb and mysql both include DBD::MariaDB and DBD::mysql. The difference is in the C libraries they are built with.

How to use this image

Simple application

Go to your code folder, call Mojolicious to create the basic application structure with you as the owner.

$ docker container run --rm -u $UID -v "$(pwd):/usr/src/app" tekki/mojolicious mojo generate app MyApp

Start the application as daemon.

$ cd my_app
$ docker container run -d --rm -v "$(pwd):/usr/src/app" -p 3000:3000 tekki/mojolicious morbo script/my_app

To run the container in the foreground and read the output, omit the -d.

$ docker container run --rm -v "$(pwd):/usr/src/app" -p 3000:3000 tekki/mojolicious morbo script/my_app

Browse to localhost:3000 and edit the code in the current folder. If you are on Linux or MacOS, the server will restart whenever you change a file. On Windows this works if you use Docker Desktop with WSL 2.

To switch from development to production an run the application as daemon in the full featured non-blocking web server start it with

$ docker container run -d --rm -v "$(pwd):/usr/src/app" -p 3000:3000 tekki/mojolicious script/my_app prefork

Source

The source of this image on GitHub.