Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Example of Catalyst 5.9 running on dotCloud
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/Catalyst
root
script
t
.dotcloudignore
.gitignore
Changes
Makefile.PL
README.pod
app.psgi
catalyst_dotcloud.conf
dotcloud.yml
nginx.conf

README.pod

Catalyst 5.9 on dotCloud

This is an example of what's needed to run Catalyst 5.9 on dotCloud. It's just the skeleton app created by catalyst.pl

The interesting parts are in these files:

  • .dotcloudignore
  • app.psgi
  • dotcloud.yml
  • nginx.conf

.dotcloudignore

The file looks like this:

    - /t
    - /script

No need to sync test to production environment. And no need to sync scripts, we'll be using PSGI

app.psgi

The file looks like this:

    #!/usr/bin/env perl

    use strict;
    use warnings;
    use lib 'lib';
    use Catalyst::DotCloud;
    use Plack::Builder;

    builder {
        enable 'Plack::Middleware::BufferedStreaming';
        Catalyst::DotCloud->psgi_app(@_);
    };

The only thing to notice here, is that we're enabling Plack::Middleware::BufferedStreaming, to to get around incompatabilities between Catalyst 5.9 and uWSGI.

dotcloud.yml

The file looks like this:

    ---
    www:
        type: perl
        requirements:
            - 'Module::Install::Catalyst'
            - 'Plack::Builder'
            - 'Plack::Middleware::BufferedStreaming'

Notice the requirements. Module::Install::Catalyst is needed by Makefile.PL, if it's not there the makefile won't run, and the requirements listed there won't be installed. The last two is needed for our app.psgi file.

nginx.conf

The file looks like this:

    location /static/ {
        root /home/dotcloud/current/root;
    }

DotCloud defaults to serving static content from a directory called static in the base directory. This makes dotCloud serve static files also from root/static.

Something went wrong with that request. Please try again.