From 5f9ca587531bcb19f28d608b7c295aef1399f589 Mon Sep 17 00:00:00 2001 From: coremoon <237020170+coremoon@users.noreply.github.com> Date: Sun, 7 Dec 2025 14:48:31 +0100 Subject: [PATCH] fixed docker deployment --- .dockerignore | 21 +++++++++++++++++++++ Dockerfile | 8 ++++---- Trunk.toml | 8 ++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 .dockerignore create mode 100644 Trunk.toml 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"]