How can I manage Dancer web server deployment?

Say I have a standalone Dancer web browser. I can deploy it to the host by running make dist, getting tarball, then installing it via cpanm or similar. However, I cannot find how to manage this deployment. When I just uninstall the application and then install the application in another place, it looks like it is installing the application modules. However, the script application, various html files and templates, environment configuration files are not installed on the local file system.

What is the correct way to go from webapp to system a -> tarball -> webapp on system b?

Edit:

Sorry, I had to clarify that I understand that I can do all this manually. I am simply surprised that there is no quick way to complete the installation with a few commands or indicate in the application where, in his opinion, various components can be installed.

Since I use cpanm for the most part, this simplifies things in system B, since I can just extract it to a directory, change it, run "cpanm". and it installs the dependencies and application modules in the system library.

However, this leads to the presence of application modules both in <> / lib / and in the installation path of the perllib system. It also means that the user needs a little understanding of perl.

I think I'm just trying to find out if things have changed since What is the best system for installing a Perl web application? was asked three years ago. With all the achievements of the modern modern level of Perl, it seems that this is a problem that could now be dealt with.

+8
perl dancer
source share
1 answer

Here is one way. Create your application on system-a:

dancer -a Foo cd Foo perl Makefile.PL make dist scp Foo-0.1.tar.gz system-b: ssh system-b 

On the -b system:

 sudo tar xf Foo-0.1.tar.gz -C /opt cd /opt/Foo-0.1 perl Makefile.PL # this will tell you the deps you need to install # install needed deps if any make sudo make install ./bin/app.pl # this starts your app 

This approach installs your application in / opt / Your -App. All your configuration files, scripts, etc. Will be contained in one folder.

Something you might want to consider is to link all your folders to your application. You would do it on system-a. (Note that this requires that system-a and system-b have the same architecture). An easy way to link your depots to App :: cpanminus:

 cpanm -L extlib Dancer Plack YAML # and any other deps 

Then, when you deploy your application, you will do something like:

 perl -Ilib -Iextlib/lib/perl5 -Iextlib/lib/perl5/x86_64-linux ./bin/app.pl 

This approach ensures that you do not need to install anything in system-b. You can simply extract your application and run it.

+5
source share

All Articles