Skip to content

Commit b316b8e

Browse files
committedMar 13, 2020
Update dockerfiles
1 parent 3d07a73 commit b316b8e

File tree

2 files changed

+15
-23
lines changed

2 files changed

+15
-23
lines changed
 

‎Dockerfile.bin

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
FROM rust:1.36-slim
1+
FROM rust:latest as rust
22

33
WORKDIR /rustpython
44

55
COPY . .
66

77
RUN 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" ]

‎Dockerfile.wasm

+7-21
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
1-
FROM rust:1.36-slim AS rust
1+
FROM rust:slim AS rust
22

33
WORKDIR /rustpython
44

55
USER root
6-
ENV USER=root
6+
ENV USER root
77

88

99
RUN 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

2214
RUN cd wasm/lib/ && wasm-pack build --release
2315

@@ -33,14 +25,8 @@ COPY wasm/demo .
3325
RUN 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

0 commit comments

Comments
 (0)
Please sign in to comment.