There was an error while loading. Please reload this page.
1 parent 3d07a73 commit b316b8eCopy full SHA for b316b8e
2 files changed
Dockerfile.bin
@@ -1,9 +1,15 @@
1
-FROM rust:1.36-slim
+FROM rust:latest as rust
2
3
WORKDIR /rustpython
4
5
COPY . .
6
7
RUN cargo build --release
8
9
-CMD [ "/rustpython/target/release/rustpython" ]
+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" ]
Dockerfile.wasm
@@ -1,23 +1,15 @@
-FROM rust:1.36-slim AS rust
+FROM rust:slim AS rust
USER root
-ENV 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 Cargo.toml Cargo.lock ./
-COPY src src
-COPY vm vm
-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
+COPY . .
21
22
RUN cd wasm/lib/ && wasm-pack build --release
23
@@ -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
0 commit comments