* add keyboard handler * some cleanup * add l key binding * Fix WASM shared memory generation for Rust nightly 2025-10-20+ Add explicit linker flags for shared memory generation after Rust PR #147225 removed automatic flags with +atomics. This fixes DataCloneError when sharing memory with workers. Changes: - Add --shared-memory, --max-memory, --import-memory flags - Export TLS symbols: __wasm_init_tls, __tls_size, __tls_align, __tls_base - Update both Cargo.toml and package.json build scripts Amp-Thread-ID: https://ampcode.com/threads/T-41d99b69-5754-4fdf-b06e-a46343fa7485 Co-authored-by: Amp <amp@ampcode.com> * add a level-editor crate * remove redundant worker setup * simplify app setup * add SceneBuilder * separate out default scene implementation in a crate * define default method for MeshBuilder --------- Co-authored-by: Amp <amp@ampcode.com>
39 lines
1023 B
Docker
39 lines
1023 B
Docker
FROM node:22-alpine
|
|
|
|
# Install Rust nightly and required tools
|
|
RUN apk add --no-cache \
|
|
build-base \
|
|
curl \
|
|
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
|
|
&& source ~/.cargo/env \
|
|
&& rustup default nightly-2025-10-20 \
|
|
&& rustup toolchain install nightly-2025-10-20 \
|
|
&& rustup target add wasm32-unknown-unknown --toolchain nightly-2025-10-20 \
|
|
&& rustup component add rust-src --toolchain nightly-2025-10-20 \
|
|
&& curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|
|
|
# Set environment variables for Rust
|
|
ENV PATH="/root/.cargo/bin:$PATH"
|
|
ENV RUSTFLAGS="-C target-feature=+atomics,+bulk-memory,+mutable-globals"
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package.json yarn.lock ./
|
|
|
|
# Install Node.js dependencies
|
|
RUN yarn install
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the project
|
|
RUN yarn run build
|
|
|
|
# Expose port for serving
|
|
EXPOSE 8080
|
|
|
|
# Command to serve the built application
|
|
CMD ["yarn", "start", "--", "--host"]
|