Making sure dotcloud serves static files not Dancer

Dancer is a great framework. It does a great job making a default development work out of the box. Its a nice alternative to some of the heavier ones that require quite a bit of setup (actually most Perl web frameworks do a great job of this).

Also it makes sure to serve static content (to avoid deployment issues, I assume). But compared to nginx or apache it is much slower at serving this (not a big surprise). In my dotcloud deployments I've found this to be a bit confusing to make sure nginx handles it instead of Dancer.

My first pass at this was setting up these symlinks in my source tree:
static/css         --> ../public/css
static/javascripts --> ../public/javascripts 
and such.

It felt wrong to have this inside source control so I dug around a bit and ran into the postinstall script that is supported by the deploy dotcloud command option.

I added the following link commands to mine to create those nice symlinks:
#!/bin/sh

# used for dotcloud deployment

# setup static symlinks
ln -s ../public/images static/
ln -s ../public/css static/ 
ln -s ../public/javascripts static/
ln -s ../public/favicon.ico static/favicon.ico

Nice, pretty and only used for dotcloud deployments.

__END__

Comments

  1. Some casinos are forgiving when a real mistake happens, corresponding to betting $6 one time. However, others are far stricter and can direct you to the max wager rule of their terms and circumstances when they take away your bonus. Following a successful transaction, your steadiness will show how a lot cash 토토사이트 you could have} out there. Now it’s time to browse the sport foyer and play your favourite casino video games.

    ReplyDelete

Post a Comment

Popular posts from this blog

Changing Dancer::Plugin::Ajax's content type

BootstrapX clickover

2 ways to get SQLite to put dates into columns