File tree Expand file tree Collapse file tree 2 files changed +15
-23
lines changed
Expand file tree Collapse file tree 2 files changed +15
-23
lines changed Original file line number Diff line number Diff line change 1- FROM rust:1.36-slim
1+ FROM rust:latest as rust
22
33WORKDIR /rustpython
44
55COPY . .
66
77RUN cargo build --release
88
9- CMD [ "/rustpython/target/release/rustpython" ]
9+ FROM debian:stable-slim
10+
11+ COPY --from=rust /rustpython/target/release/rustpython /usr/bin
12+ COPY --from=rust /rustpython/Lib /usr/lib/rustpython
13+ ENV RUSTPYTHONPATH /usr/lib/rustpython
14+
15+ ENTRYPOINT [ "rustpython" ]
Original file line number Diff line number Diff line change 1- FROM rust:1.36- slim AS rust
1+ FROM rust:slim AS rust
22
33WORKDIR /rustpython
44
55USER root
6- ENV USER= root
6+ ENV USER root
77
88
99RUN apt-get update && apt-get install curl libssl-dev pkg-config -y && \
1010 curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
1111
12- COPY Cargo.toml Cargo.lock ./
13- COPY src src
14- COPY vm vm
15- COPY derive derive
16- COPY parser parser
17- COPY bytecode bytecode
18- COPY compiler compiler
19- COPY wasm/lib wasm/lib
20- COPY Lib Lib
12+ COPY . .
2113
2214RUN cd wasm/lib/ && wasm-pack build --release
2315
@@ -33,14 +25,8 @@ COPY wasm/demo .
3325RUN npm install && npm run dist -- --env.noWasmPack --env.rustpythonPkg=rustpython_wasm
3426
3527
36- FROM node:slim
28+ FROM nginx:alpine
3729
38- WORKDIR /rustpython-demo
39-
40- RUN npm i -g serve
41-
42- COPY --from=node /rustpython-demo/dist .
43-
44- CMD [ "serve", "-l", "80", "/rustpython-demo" ]
45-
46- EXPOSE 80
30+ COPY --from=node /rustpython-demo/dist /usr/share/nginx/html
31+ # Add the WASM mime type
32+ RUN echo "types { application/wasm wasm; }" >>/etc/nginx/mime.types
You can’t perform that action at this time.
0 commit comments