-
Notifications
You must be signed in to change notification settings - Fork 50
/
Dockerfile
44 lines (26 loc) · 898 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM rust:latest AS wasm-build
RUN mkdir -p /usr/build/
WORKDIR /usr/build/
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
COPY . .
WORKDIR /usr/build/harper-wasm
RUN wasm-pack build --release --target web
FROM node:slim AS node-build
RUN mkdir -p /usr/build/
WORKDIR /usr/build/
RUN mkdir harper-wasm
COPY --from=wasm-build /usr/build/harper-wasm/pkg /usr/build/harper-wasm/pkg
COPY packages packages
COPY demo.md .
WORKDIR /usr/build/packages/harper.js
RUN yarn install && yarn build
WORKDIR /usr/build/packages/web
RUN yarn install && yarn build
FROM node:slim
COPY --from=node-build /usr/build/packages/web/build /usr/build/packages/web/build
COPY --from=node-build /usr/build/packages/web/package.json /usr/build/packages/web/package.json
WORKDIR /usr/build/packages/web
RUN yarn install
ENV HOST=0.0.0.0
ENV PORT=3000
ENTRYPOINT ["node", "build"]