Skip to content

Commit 3e3d28f

Browse files
committed
Create dockerfiles for the rustpython binary and wasm demo
1 parent d508d13 commit 3e3d28f

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target
2+
**/node_modules

Dockerfile.bin

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM rust:1.31-slim
2+
3+
WORKDIR /rustpython
4+
5+
COPY . .
6+
7+
RUN cargo build --release
8+
9+
CMD [ "/rustpython/target/release/rustpython" ]

Dockerfile.wasm

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM rust:1.31-slim
2+
3+
RUN apt-get update && apt-get install curl gnupg -y && \
4+
curl -o- https://deb.nodesource.com/setup_10.x | bash && \
5+
apt-get install nodejs -y && \
6+
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh && \
7+
npm i -g serve
8+
9+
WORKDIR /rustpython
10+
11+
COPY . .
12+
13+
RUN cd ./wasm/lib/ && \
14+
cargo build --release && \
15+
cd ../demo && \
16+
npm install && \
17+
npm run dist
18+
19+
CMD [ "serve", "/rustpython/wasm/demo/dist" ]

0 commit comments

Comments
 (0)