diff --git a/Dockerfile b/Dockerfile index a4ee957..0462bb0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,20 +29,31 @@ RUN git clone -b ext https://git.4nkweb.com/4nk/sdk_client.git WORKDIR /build/sdk_client RUN wasm-pack build --out-dir ../sdk_signer/pkg --target nodejs --dev -FROM node:20-alpine +FROM debian:bookworm-slim 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/* +RUN apt-get update && apt-get upgrade -y && \ + apt-get install -y --fix-missing \ + ca-certificates curl jq git && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# Installation de Node.js +RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ + apt-get install -y nodejs && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# Création d'un utilisateur non-root +RUN useradd -m -u 1000 appuser && \ + mkdir -p /app && chown -R appuser:appuser /app # Copie des fichiers du projet COPY --from=wasm-builder /build/sdk_signer/pkg ./pkg COPY . . +RUN chown -R appuser:appuser /app # Installation des dépendances Node.js +USER appuser RUN npm install RUN npm run build