-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
60 lines (52 loc) · 1.71 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM primordus/eclair:v0.1.0 as stage1
WORKDIR /app/bakery
RUN git clone https://github.com/wingo/walloc /tmp/walloc \
&& cd /tmp/walloc \
&& clang -Oz --target=wasm32 -mbulk-memory -nostdlib -c -o walloc.o walloc.c \
&& cd /app/bakery \
&& cp /tmp/walloc/walloc.o .
COPY package.json package-lock.json ./
RUN source /root/.nvm/nvm.sh && npm install
COPY . .
CMD [ "node", "src/index.js" ]
FROM ubuntu:20.04 as bakery_app
WORKDIR /app/bakery
ENV DATALOG_DIR=/app/bakery/cbits
EXPOSE 8080
# Copy over minimal libs and bin for Eclair
COPY --from=stage1 /app/build/dist-newstyle/build/x86_64-linux/ghc-9.0.2/eclair-lang-0.0.1/x/eclair/build/eclair/eclair /usr/bin
COPY --from=stage1 /app/build/cbits/ /app/bakery/cbits/
COPY --from=stage1 \
/lib/x86_64-linux-gnu/libLLVM-14.so.1 \
/lib/x86_64-linux-gnu/libxml2.so.2 \
/lib/x86_64-linux-gnu/libedit.so.2 \
/lib/x86_64-linux-gnu/libbsd.so.0 \
/lib/x86_64-linux-gnu/libicuuc.so.66 \
/lib/x86_64-linux-gnu/libicudata.so.66 \
/usr/lib/
# Same for Souffle
COPY --from=stage1 \
/usr/bin/mcpp \
/usr/local/bin/souffle-compile.py \
/usr/local/bin/souffle \
/usr/bin/
COPY --from=stage1 \
/lib/x86_64-linux-gnu/libmcpp.so.0 \
/lib/x86_64-linux-gnu/libsqlite3.so.0 \
/lib/x86_64-linux-gnu/libgomp.so.1 \
/usr/lib/
# Same for clang and wasm-ld
COPY --from=stage1 /usr/bin/clang-14 /usr/bin/wasm-ld-14 /usr/bin/
COPY --from=stage1 /lib/x86_64-linux-gnu/libclang-cpp.so.14 /usr/lib/
# Same for walloc
COPY --from=stage1 /app/bakery/walloc.o .
# Same for node
COPY --from=stage1 \
/root/.nvm/nvm.sh \
/root/.nvm/versions/node/v18.1.0/bin/node \
/usr/bin/
COPY --from=stage1 \
/app/bakery/node_modules \
/app/bakery/node_modules/
COPY . .
CMD [ "node", "src/index.js" ]