Docker
A Dockerfile and .dockerignore are included in every project scaffolded by wasm-drydock init. The Dockerfile uses a multi-stage build to produce a minimal production image.
Build stages
chef — base image with all build tools installed:
- Rust toolchain
- wasm-pack
- wasm32-unknown-unknown target
- cargo-chef for dependency caching
planner — analyses the dependency graph and produces recipe.json
builder — cooks dependencies from recipe.json, then builds the project:
wasm-pack build --releaseon the frontendgrasscompiles SCSS to CSScargo build --release --features embed-assetson the backend
Final stage — copies only the release binary into a minimal debian:bookworm-slim image.
Building
docker build -t my-app .
Running
docker run -p 3001:3001 \
-e APP_ENVIRONMENT=production \
-e APP_APPLICATION__HOST=0.0.0.0 \
my-app
Skipping deployment files
If you don't need deployment files, use the --no-deploy flag:
wasm-drydock init my-app --no-deploy