From b1d46ace23c3e3a6bedf6112cde4642dce7af73f Mon Sep 17 00:00:00 2001 From: heyarne Date: Mon, 11 May 2020 16:17:20 +0200 Subject: [PATCH] Change Dockerfile CMD so it does not need to know about an app's namespaces --- Dockerfile | 17 ++++++++++++----- deps.edn | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6171b84..e25ca48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,24 @@ FROM theasp/clojurescript-nodejs:shadow-cljs-alpine as build WORKDIR /app -# RUN apk --no-cache add python alpine-sdk COPY package.json package-lock.json deps.edn shadow-cljs.edn /app/ -RUN npm ci - COPY . . -RUN clojure -A:cljs -m shadow.cljs.devtools.cli release app + +# compile server RUN clojure -A:uberjar +# compile client +RUN npm ci +RUN clojure -A:cljs -m shadow.cljs.devtools.cli release app + FROM alpine:3.9 RUN apk add --no-cache openjdk8 WORKDIR /app + +# this will be nicely mounted by dokku-docker-auto-volumes +VOLUME /app/uploads COPY --from=build /app /app + +# Run the compiled artefact RUN cd /app/target/ && mv *-standalone.jar app-standalone.jar -CMD java -cp /app/target/app-standalone.jar heyarne.all_my_friends.server +CMD java -jar /app/target/app-standalone.jar diff --git a/deps.edn b/deps.edn index 762e489..de1d414 100644 --- a/deps.edn +++ b/deps.edn @@ -19,4 +19,4 @@ ;; packaging the server as a standalone jar for production :uberjar {:extra-deps {luchiniatwork/cambada {:mvn/version "1.0.2"}} :main-opts ["-m" "cambada.uberjar" - "-m" "heyarne.all-my-friends.server"]}}} + "-m" "heyarne.all_my_friends.server"]}}}