This repository was archived by the owner on May 11, 2023. It is now read-only.
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
2
2
3
3
WORKDIR /rustpython
4
4
5
5
COPY . .
6
6
7
7
RUN cargo build --release
8
8
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
2
2
3
3
WORKDIR /rustpython
4
4
5
5
USER root
6
- ENV USER= root
6
+ ENV USER root
7
7
8
8
9
9
RUN apt-get update && apt-get install curl libssl-dev pkg-config -y && \
10
10
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
11
11
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 . .
21
13
22
14
RUN cd wasm/lib/ && wasm-pack build --release
23
15
@@ -33,14 +25,8 @@ COPY wasm/demo .
33
25
RUN npm install && npm run dist -- --env.noWasmPack --env.rustpythonPkg=rustpython_wasm
34
26
35
27
36
- FROM node:slim
28
+ FROM nginx:alpine
37
29
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