Philipp Meier - Software Developer

Abstracting the pain away

Run Clojure Web Apps on Red Hat's Openshift

| Comments

The other day I was toying around with RedHat’s PaaS openshift. Openshift has a free developer preview but here is currently no support for running leiningen or clojure apps. However, you can use the Do-It-Yourself application type and add the following as hooks to run leiningen yourself. The repository directory and home dir must be set because the home dir and working dir are read only. Leiningen or the maven libs seem to ignore $HOME, so I used -Duser.home to force the repository to another location.

I tested it with a dummy ring web application that runs with ring-jetty-adapter and binds to to $OPENSHIFT_INTERNAL_IP:$OPENSHIFT_INTERNAL_PORT

Another option is to use the available JBossAS-7 cartridge and deploy a .war-file. I failed to build an uberwar with the lein ring plugin, but this should be a perfectly valid option, too.