1

I have a Clojure REST service written in Clojure/Ring/Jetty. In development process I have ran them from command line lein run serve, but now I want to run them to production.

What is the correct way to do it ? In the .NET world I am using IIS (Internet Information Server) to host web applications. What do I need to use in the JVM ? Tomcat or any other servlet container ?

ceth
  • 44,198
  • 62
  • 180
  • 289
  • @nha My question is not about deployment and building. My question is about web servers and hosting. And I cannot find the answer in your link. – ceth Nov 04 '16 at 14:21
  • 3
    This is going to be opinion. Yes you can use Tomcat (a common solution) or any other servlet container but there is no _correct_ way to do it. The best option depends on a whole lot of factors that are outside the scope of your question. – z7sg Ѫ Nov 04 '16 at 14:33
  • @z7sgѪ Thanks, so Ring application is a real servlet, right? And I can use any application server that can host servlets. Am I right ? – ceth Nov 04 '16 at 14:35
  • Yes. You might find `lein-ring` useful to build wars. I have deployed them to production on Tomcat in the past, simply because that was the app server ops wanted to use. – z7sg Ѫ Nov 04 '16 at 14:41

1 Answers1

1

Usually, I prefer to run clojure as standalone java applications. You can build an executable jar with lein uberjar. You cal take a look at this tutorial uberjar.

This will build you -standalone.jar. Than if you are in linux environment just run as following nohup java -jar <projectname>-standalone.jar

r00tt
  • 257
  • 3
  • 18