Change Dockerfile CMD so it does not need to know about an app's namespaces

This commit is contained in:
heyarne 2020-05-11 16:17:20 +02:00
commit b1d46ace23
2 changed files with 13 additions and 6 deletions

View file

@ -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

View file

@ -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"]}}}