86 lines
1.5 KiB
Docker
86 lines
1.5 KiB
Docker
# syntax=docker/dockerfile:1.4
|
|
FROM rust:1.85-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 \
|
|
perl
|
|
|
|
# Installation de wasm-pack et wasm-bindgen
|
|
RUN cargo install wasm-pack
|
|
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 ext 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 upgrade && apk add --no-cache \
|
|
git \
|
|
curl \
|
|
wget \
|
|
jq \
|
|
busybox-extras \
|
|
npm \
|
|
coreutils \
|
|
build-base \
|
|
autoconf \
|
|
automake \
|
|
libtool \
|
|
pkgconfig \
|
|
cmake \
|
|
ninja \
|
|
clang \
|
|
lldb \
|
|
lld \
|
|
make \
|
|
tree \
|
|
ncdu \
|
|
mc \
|
|
ctags \
|
|
cscope \
|
|
vim \
|
|
emacs \
|
|
sed \
|
|
gawk \
|
|
iputils \
|
|
net-tools \
|
|
iproute2 \
|
|
python3 \
|
|
python3-dev \
|
|
py3-pip \
|
|
go \
|
|
rust \
|
|
cargo \
|
|
&& npm install -g wscat
|
|
|
|
# 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"] |