diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c99ffe6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,21 @@ +# Dockerfile itself not needed inside build +Dockerfile + +# Docs & licenses +LICENSE +README.md +doc/ + +# Nix and CI +deploy.nix +flake.nix +flake.lock + +# Linter config +clippy.toml + +# Optional: scripts not needed for build +fix-links.sh + +# Optional: task runner +justfile diff --git a/Dockerfile b/Dockerfile index a71c86e..f0b6b91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN apt-get update && \ npm && \ rm -rf /var/lib/apt/lists/* -# Install Rust and the wasm32 target +# Install Rust and wasm32 target ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH @@ -38,8 +38,8 @@ WORKDIR /app COPY . . # Build the application -RUN trunk build --release && \ - sh fix-links.sh +RUN rustup target add wasm32-unknown-unknown +RUN trunk build --release # Stage 2: Final Image # This stage creates a minimal image to serve the built static files. @@ -50,4 +50,4 @@ COPY --from=builder /app/dist /usr/share/nginx/html # Expose port 80 and start Nginx EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file +CMD ["nginx", "-g", "daemon off;"] diff --git a/Trunk.toml b/Trunk.toml new file mode 100644 index 0000000..0a0af6a --- /dev/null +++ b/Trunk.toml @@ -0,0 +1,8 @@ +[build] +# target = "wasm32-unknown-unknown" +release = true +dist = "dist" +public-url = "/" + +[watch] +ignore = ["node_modules"]