Fork me on GitHub
#leiningen
<
2020-12-20
>
Yehonathan Sharvit13:12:11

A question about the proper way to run a service on production. Which one is better: lein run or lein uberjar then java ...

jumar14:12:15

Bo need to install leiningen on production - build an uberjar and use java to run it

andy.fingerhut14:12:32

If lein uberjar is done on dev machine, and only java ... is done on production machine, then Leiningen doesn't need to be on production machines at all.

andy.fingerhut14:12:48

lein run on production machines opens you up to the possibility that production machines need to connect to Maven central, Clojars, etc. sites to download code, which could fail. If there are any SNAPSHOT versions anywhere in the dependency tree, it opens you up to the possibility of different production machines getting different versions of code at different times.

andy.fingerhut14:12:51

The only con I can think of to using lein uberjar on production machines is whatever steps you take to get that working, which in many cases I suspect is pretty quick.

Alex Miller (Clojure team)16:12:30

Using lein to start a production instance seems deeply weird to me (even though it is apparently very common)

noisesmith18:12:03

if you jump through enough hoops (using trampoline so you're not running an extra VM, using the right java system property settings) it almost works, but there's zero benefit

noisesmith18:12:19

I guess "the server does the same thing I do locally" is almost a benefit

Alex Miller (Clojure team)19:12:08

seems worth it to me solely to remove the risk of a code base that's not yours in the startup path

noisesmith19:12:20

yeah, not using a build tool on prod is a no brainer

Yehonathan Sharvit13:12:18

What are the pros and cons?