# Starting from node FROM node:22-slim ENV NODE_ENV=production WORKDIR /app # Copy package files first COPY package.json package-lock.json* . # Install build dependencies, compile native modules, then remove build tools RUN apt-get update && \ apt-get install -y ffmpeg python3 make g++ && \ npm ci --only=production --ignore-scripts && \ npm install bufferutil zlib-sync && \ apt-get remove -y python3 make g++ && \ apt-get autoremove -y && \ rm -rf /var/lib/apt/lists/* # Copy the builded files and the charts COPY ./dist/* . # Set the permissions RUN chown -R node:node /app USER node # Start the application CMD ["npm", "start"]