caddy fiilailuu

This commit is contained in:
2026-04-01 18:27:29 +03:00
parent cd1dd9a363
commit 29b4524027
4 changed files with 34 additions and 5 deletions

View File

@@ -7,7 +7,29 @@ RUN apt-get update && apt-get install -y \
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
WORKDIR /app
COPY . .
# 1. Kopioi vain Cargo-tiedostot → riippuvuudet cacheen
COPY Cargo.toml Cargo.lock ./
COPY hub/Cargo.toml hub/Cargo.toml
COPY node/Cargo.toml node/Cargo.toml
COPY native-node/Cargo.toml native-node/Cargo.toml
# Tyhjät lähteet riippuvuuksien esikääntämistä varten
RUN mkdir -p hub/src node/src native-node/src \
&& echo "fn main(){}" > hub/src/main.rs \
&& echo "" > node/src/lib.rs \
&& mkdir -p node/src && touch node/src/storage.rs \
&& echo "fn main(){}" > native-node/src/main.rs \
&& cargo build --release -p hub 2>/dev/null || true \
&& wasm-pack build node --target web --out-dir ../static/pkg 2>/dev/null || true
# 2. Kopioi oikea lähdekoodi → vain src käännetään uudelleen
COPY hub/src hub/src
COPY node/src node/src
COPY static static
# Pakota uudelleenkäännös
RUN touch hub/src/main.rs node/src/lib.rs
# Rakenna Wasm-paketti
RUN cd node && wasm-pack build --target web --out-dir ../static/pkg