24 lines
662 B
Docker
24 lines
662 B
Docker
FROM theasp/clojurescript-nodejs:shadow-cljs-alpine as build
|
|
WORKDIR /app
|
|
|
|
COPY package.json package-lock.json deps.edn shadow-cljs.edn /app/
|
|
COPY . .
|
|
|
|
# compile client
|
|
RUN npm ci
|
|
RUN clojure -A:cljs -m shadow.cljs.devtools.cli release app
|
|
|
|
# compile server; this needs to come second, otherwise there will be no JS files in the jar
|
|
RUN clojure -A:uberjar
|
|
|
|
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 -jar /app/target/app-standalone.jar
|