Skip to content

Commit

Permalink
Update dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
coolreader18 committed Mar 13, 2020
1 parent 3d07a73 commit b316b8e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 deletions.
10 changes: 8 additions & 2 deletions Dockerfile.bin
@@ -1,9 +1,15 @@
FROM rust:1.36-slim
FROM rust:latest as rust

WORKDIR /rustpython

COPY . .

RUN cargo build --release

CMD [ "/rustpython/target/release/rustpython" ]
FROM debian:stable-slim

COPY --from=rust /rustpython/target/release/rustpython /usr/bin
COPY --from=rust /rustpython/Lib /usr/lib/rustpython
ENV RUSTPYTHONPATH /usr/lib/rustpython

ENTRYPOINT [ "rustpython" ]
28 changes: 7 additions & 21 deletions Dockerfile.wasm
@@ -1,23 +1,15 @@
FROM rust:1.36-slim AS rust
FROM rust:slim AS rust

WORKDIR /rustpython

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
COPY parser parser
COPY bytecode bytecode
COPY compiler compiler
COPY wasm/lib wasm/lib
COPY Lib Lib
COPY . .

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

Expand All @@ -33,14 +25,8 @@ COPY wasm/demo .
RUN npm install && npm run dist -- --env.noWasmPack --env.rustpythonPkg=rustpython_wasm


FROM node:slim
FROM nginx:alpine

WORKDIR /rustpython-demo

RUN npm i -g serve

COPY --from=node /rustpython-demo/dist .

CMD [ "serve", "-l", "80", "/rustpython-demo" ]

EXPOSE 80
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

0 comments on commit b316b8e

Please sign in to comment.