Change Dockerfile CMD so it does not need to know about an app's namespaces
This commit is contained in:
parent
2ba7486d91
commit
b1d46ace23
2 changed files with 13 additions and 6 deletions
17
Dockerfile
17
Dockerfile
|
|
@ -1,17 +1,24 @@
|
||||||
FROM theasp/clojurescript-nodejs:shadow-cljs-alpine as build
|
FROM theasp/clojurescript-nodejs:shadow-cljs-alpine as build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
# RUN apk --no-cache add python alpine-sdk
|
|
||||||
|
|
||||||
COPY package.json package-lock.json deps.edn shadow-cljs.edn /app/
|
COPY package.json package-lock.json deps.edn shadow-cljs.edn /app/
|
||||||
RUN npm ci
|
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN clojure -A:cljs -m shadow.cljs.devtools.cli release app
|
|
||||||
|
# compile server
|
||||||
RUN clojure -A:uberjar
|
RUN clojure -A:uberjar
|
||||||
|
|
||||||
|
# compile client
|
||||||
|
RUN npm ci
|
||||||
|
RUN clojure -A:cljs -m shadow.cljs.devtools.cli release app
|
||||||
|
|
||||||
FROM alpine:3.9
|
FROM alpine:3.9
|
||||||
RUN apk add --no-cache openjdk8
|
RUN apk add --no-cache openjdk8
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# this will be nicely mounted by dokku-docker-auto-volumes
|
||||||
|
VOLUME /app/uploads
|
||||||
COPY --from=build /app /app
|
COPY --from=build /app /app
|
||||||
|
|
||||||
|
# Run the compiled artefact
|
||||||
RUN cd /app/target/ && mv *-standalone.jar app-standalone.jar
|
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
|
||||||
|
|
|
||||||
2
deps.edn
2
deps.edn
|
|
@ -19,4 +19,4 @@
|
||||||
;; packaging the server as a standalone jar for production
|
;; packaging the server as a standalone jar for production
|
||||||
:uberjar {:extra-deps {luchiniatwork/cambada {:mvn/version "1.0.2"}}
|
:uberjar {:extra-deps {luchiniatwork/cambada {:mvn/version "1.0.2"}}
|
||||||
:main-opts ["-m" "cambada.uberjar"
|
:main-opts ["-m" "cambada.uberjar"
|
||||||
"-m" "heyarne.all-my-friends.server"]}}}
|
"-m" "heyarne.all_my_friends.server"]}}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue