xitca-web-wasm.dockerfile 893 B

1234567891011121314151617181920212223242526272829303132333435
  1. ARG WASMTIME_VERSION=15.0.0
  2. ARG WASM_TARGET=wasm32-wasi-preview1-threads
  3. FROM rust:1.76 AS compile
  4. ARG WASMTIME_VERSION
  5. ARG WASM_TARGET
  6. WORKDIR /tmp
  7. COPY / ./
  8. RUN curl -LSs "https://github.com/bytecodealliance/wasmtime/releases/download/v${WASMTIME_VERSION}/wasmtime-v${WASMTIME_VERSION}-$(uname -m)-linux.tar.xz" | \
  9. tar --strip-components=1 -Jx && \
  10. rustup default nightly && \
  11. rustup target add ${WASM_TARGET} && \
  12. cargo build --bin xitca-web-wasm --features web --release --target ${WASM_TARGET}
  13. FROM ubuntu:22.04
  14. ARG WASM_TARGET
  15. ARG BENCHMARK_ENV
  16. ARG TFB_TEST_DATABASE
  17. ARG TFB_TEST_NAME
  18. COPY --from=compile \
  19. /tmp/target/${WASM_TARGET}/release/xitca-web-wasm.wasm \
  20. /tmp/wasmtime \
  21. /opt/xitca-web-wasm/
  22. EXPOSE 8080
  23. CMD /opt/xitca-web-wasm/wasmtime run \
  24. --wasm all-proposals=y \
  25. --wasi threads=y,tcplisten=0.0.0.0:8080 \
  26. --env FD_COUNT=3 \
  27. /opt/xitca-web-wasm/xitca-web-wasm.wasm