Clojure Docker Web Apps

If you’re interested in making a commercial grade Clojure web app that deploys as a Docker container, this is the tutorial for you.

Prerequisites: You will need Leiningen and Docker installed.

First step needed is to create a Clojure web app template project. I used the following command.

This creates a Clojure web app using the Luminus Framework, Reitit for mapping of incoming requests to the proper handlers, HTTP Kit for HTTP handling, MySQL for JDBC connections to our MySQL database, Swagger for API support, and Buddy for authentication middleware. Your new web app is in the directory, mywebapp .

Continue reading “Clojure Docker Web Apps”

JAVA_CMD for lein

Sometimes you need to configure lein  to use a custom JDK. On Linux, set the environment variable JAVA_CMD  to point to the java  executable you want lein  to use.

For example, you might add the following lines to your .bash_profile

Once you update your bash profile, you can start using your configuration by using the following command.