forked from hyperfiddle/electric-fiddle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (27 loc) · 881 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM node:14.7-stretch AS node-deps
WORKDIR /app
COPY package.json package.json
RUN npm install
FROM clojure:openjdk-11-tools-deps AS build
WORKDIR /app
COPY --from=node-deps /app/node_modules /app/node_modules
# electric-user-version is computed from git sha during clj build
COPY .git .git
#COPY .m2 /root/.m2
COPY shadow-cljs.edn shadow-cljs.edn
COPY deps.edn deps.edn
COPY src src
COPY src-build src-build
COPY src-prod src-prod
COPY vendor vendor
COPY resources resources
COPY fiddles fiddles
ARG REBUILD=unknown
ARG HYPERFIDDLE_DOMAIN
ARG ELECTRIC_USER_VERSION
RUN clojure -A:prod:$HYPERFIDDLE_DOMAIN -M -e ::ok # preload
RUN clojure -A:build:prod:$HYPERFIDDLE_DOMAIN -M -e ::ok # preload
RUN clojure -X:build:prod:$HYPERFIDDLE_DOMAIN uberjar \
:hyperfiddle/domain $HYPERFIDDLE_DOMAIN \
:build/jar-name user.jar
CMD java -cp user.jar clojure.main -m prod