sdk_signer/Dockerfile
4NK Dev b190edbf72
All checks were successful
build-and-push-ext / build_push (push) Successful in 5m45s
ci: docker_tag=ext - Optimize Dockerfile to reduce image size (remove dev tools)
2025-09-21 18:08:59 +00:00

52 lines
1.1 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 minimales nécessaires
RUN apk update && apk upgrade && apk add --no-cache \
curl \
jq \
&& rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
# 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"]