This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-26
Channels
- # announcements (7)
- # aws (1)
- # babashka (15)
- # beginners (144)
- # calva (8)
- # chlorine-clover (15)
- # clara (4)
- # clojure (65)
- # clojure-europe (131)
- # clojure-france (1)
- # clojure-nl (6)
- # clojure-nlp (3)
- # clojure-spec (10)
- # clojure-uk (52)
- # clojuredesign-podcast (2)
- # clojurescript (28)
- # cryogen (1)
- # datomic (17)
- # events (2)
- # figwheel-main (2)
- # fulcro (8)
- # hugsql (2)
- # jackdaw (4)
- # jobs (1)
- # leiningen (8)
- # lumo (1)
- # malli (4)
- # off-topic (23)
- # parinfer (3)
- # pathom (3)
- # pedestal (5)
- # re-frame (9)
- # reagent (26)
- # reitit (13)
- # reveal (25)
- # shadow-cljs (45)
- # spacemacs (7)
- # sql (7)
- # tools-deps (40)
- # vrac (2)
- # xtdb (22)
@joao.galrito don't use lein itself in production, use lein uberjar
to make a jar, then run it via java
Alright, I had searched online for "deploy clojure apps to production" and a lot of people talked about being fine using lein
the problem is that there's no advantage to lein in production, and there are actual disadvantages (in terms of resource usage, startup time for example)
there are also dedicated libraries for managing long running java programs, eg. jsvc
It is also really simple to write a .service file for systemd (or an rc file if on BSD) for running an uberjar
with a .service file how do you handle controlled shutdown - via signal handler?
Well, if you absolutely have to have code run on shutdown, you can use Runtime's addShutdownHook
but so far I wasn't in a situation where that was needed
regardless - don't use lein as a prod launcher, it's just a bad idea