librelist archives

« back to archive

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

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

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

> How have other people applied (or consciously deviated from) the
> ["Twelve Factors"]( I'm most concerned about
> [III: Config]( and [V: Build, release,
> run](

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

> 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]( and
> [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