librelist archives

« back to archive

Re: [leiningen] Leiningen, Ring, and "Twelve-Factor App" principles

Re: [leiningen] Leiningen, Ring, and "Twelve-Factor App" principles

From:
Phil Hagelberg
Date:
2013-03-08 @ 17:31
Josh Tilles writes:

> How have other people applied (or consciously deviated from) the
> ["Twelve Factors"](http://www.12factor.net/)? I'm most concerned about
> [III: Config](http://www.12factor.net/config) and [V: Build, release,
> run](http://www.12factor.net/build-release-run).

Sure. I've got a template for creating a Compojure application on
Heroku, but it could really be used anywhere:

https://github.com/technomancy/lein-heroku/tree/master/lein-template

> These questions are motivated by some recent work deploying a Clojure
> app as an uberwar to a Tomcat 6 container and spending much time
> figuring out why the environmental variables weren't getting set.
> After examining the implementation of
> [environ](https://github.com/weavejester/environ) and
> [lein-ring](https://github.com/weavejester/lein-ring), I understand
> why the variables that were accessible in `lein ring server` were not
> in the deployed result of `lein ring uberwar`. However, it's not
> obvious to me what the kosher solution is.

Since 12 Factor emphasizes that each app be completely standalone, using
Tomcat is fairly uncommon. Most people stick with Jetty since the
advantages of Tomcat don't really apply if you're going the 12-factor
route.

-Phil