45 lines
1.2 KiB
Docker
Executable File
45 lines
1.2 KiB
Docker
Executable File
# syntax=docker/dockerfile:1.4
|
|
|
|
FROM debian:bookworm-slim
|
|
WORKDIR /app
|
|
|
|
# Installation des dépendances minimales nécessaires
|
|
RUN apt-get update && apt-get upgrade -y && \
|
|
apt-get install -y --fix-missing \
|
|
ca-certificates curl jq git \
|
|
net-tools iputils-ping dnsutils \
|
|
netcat-openbsd telnet procps && \
|
|
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
|
|
|
|
# Copy project files
|
|
COPY . .
|
|
RUN chown -R appuser:appuser /app
|
|
|
|
# Ensure pkg directory exists and has correct permissions
|
|
RUN mkdir -p pkg && chmod -R 755 pkg
|
|
|
|
# Verify pkg files are present
|
|
RUN ls -la pkg/
|
|
|
|
# Copy the provided prebuilt WASM package (ESM)
|
|
# The directory pkg is provided in the build context
|
|
# and already contains sdk_client.js (ES module) and wasm
|
|
# so no compilation is required here.
|
|
|
|
# Installation des dépendances Node.js
|
|
USER appuser
|
|
RUN npm install
|
|
|
|
EXPOSE 3003
|
|
|
|
CMD ["npm", "start"]
|