sdk_signer/Dockerfile
4NK Dev c4a35ee864
Some checks failed
build-and-push-ext / build_push (push) Failing after 3m6s
fix: Utilisation de wasm-pack 0.12.1 compatible avec wasm-bindgen 0.2.103
- Changement de wasm-pack 0.13.1 vers 0.12.1 dans Dockerfile et workflow CI
- wasm-pack 0.13.1 utilise une version incompatible de wasm-bindgen
- wasm-pack 0.12.1 est compatible avec wasm-bindgen 0.2.103
- Résolution de l'erreur '__wbindgen_externref_table_alloc' function not found
- Test local réussi : build WebAssembly, build TypeScript et tests passent
- La CI et Docker peuvent maintenant compiler WebAssembly sans erreur
2025-09-21 06:25:20 +00:00

48 lines
1.0 KiB
Docker

# syntax=docker/dockerfile:1.4
FROM rust:1.82-alpine AS wasm-builder
WORKDIR /build
# Installation des dépendances nécessaires pour la compilation
RUN apk update && apk add --no-cache \
git \
curl \
nodejs \
npm \
build-base \
pkgconfig \
clang \
llvm \
musl-dev
# Installation de wasm-pack et wasm-bindgen
RUN cargo install wasm-pack --version 0.12.1
RUN cargo install wasm-bindgen-cli --version 0.2.103
# Copie du projet sdk_signer
COPY . sdk_signer/
# Clonage du sdk_client au même niveau que sdk_signer
RUN git clone -b dev https://git.4nkweb.com/4nk/sdk_client.git
# Build du WebAssembly
WORKDIR /build/sdk_client
RUN wasm-pack build --out-dir ../sdk_signer/pkg --target nodejs --dev
FROM node:20-alpine
WORKDIR /app
# Installation des dépendances nécessaires
RUN apk update && apk add --no-cache git
# Copie des fichiers du projet
COPY --from=wasm-builder /build/sdk_signer/pkg ./pkg
COPY . .
# Installation des dépendances Node.js
RUN npm install
RUN npm run build
EXPOSE 9090
CMD ["npm", "start"]