xitca-web-wasm.dockerfile 610 B

12345678910111213141516
  1. FROM rust:latest
  2. ADD ./ /xitca-web
  3. WORKDIR /xitca-web
  4. RUN rustup default nightly-2023-02-20
  5. RUN rustup target add wasm32-wasi
  6. RUN cargo clean
  7. RUN RUSTFLAGS="--cfg tokio_unstable" cargo build --release --bin xitca-web-wasm --target wasm32-wasi --features web
  8. RUN curl --show-error --location --fail https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.0/wasmtime-v6.0.0-x86_64-linux.tar.xz --output wasmtime.tar.xz
  9. RUN tar -xvf wasmtime.tar.xz
  10. EXPOSE 8080
  11. CMD ./wasmtime-v6.0.0-x86_64-linux/wasmtime ./target/wasm32-wasi/release/xitca-web-wasm.wasm --tcplisten 0.0.0.0:8080 --env FD_COUNT=3