forked from RustPython/RustPython
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.wasm
32 lines (17 loc) · 667 Bytes
/
Dockerfile.wasm
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
FROM rust:slim AS rust
WORKDIR /rustpython
USER root
ENV USER root
RUN apt-get update && apt-get install curl libssl-dev pkg-config -y && \
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
COPY . .
RUN cd wasm/lib/ && wasm-pack build --release
FROM node:alpine AS node
WORKDIR /rustpython-demo
COPY --from=rust /rustpython/wasm/lib/pkg rustpython_wasm
COPY wasm/demo .
RUN npm install && npm run dist -- --env.noWasmPack --env.rustpythonPkg=rustpython_wasm
FROM nginx:alpine
COPY --from=node /rustpython-demo/dist /usr/share/nginx/html
# Add the WASM mime type
RUN echo "types { application/wasm wasm; }" >>/etc/nginx/mime.types