xitca-web-wasm.dockerfile 865 B

12345678910111213141516171819202122232425262728293031323334
  1. ARG WASMTIME_VERSION=15.0.0
  2. ARG WASM_TARGET=wasm32-wasi-preview1-threads
  3. FROM rust:1.74 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 target add ${WASM_TARGET} && \
  11. cargo build --bin xitca-web-wasm --features web --release --target ${WASM_TARGET}
  12. FROM ubuntu:22.04
  13. ARG WASM_TARGET
  14. ARG BENCHMARK_ENV
  15. ARG TFB_TEST_DATABASE
  16. ARG TFB_TEST_NAME
  17. COPY --from=compile \
  18. /tmp/target/${WASM_TARGET}/release/xitca-web-wasm.wasm \
  19. /tmp/wasmtime \
  20. /opt/xitca-web-wasm/
  21. EXPOSE 8080
  22. CMD /opt/xitca-web-wasm/wasmtime run \
  23. --wasm all-proposals=y \
  24. --wasi threads=y,tcplisten=0.0.0.0:8080 \
  25. --env FD_COUNT=3 \
  26. /opt/xitca-web-wasm/xitca-web-wasm.wasm