Dockerfile (702B)
1 FROM node:20-slim 2 3 # Install system dependencies 4 # We add git because some npm packages require it to fetch dependencies. 5 # We add python3, make, and g++ because some crypto libraries used by Baileys 6 # might need to compile native code. 7 RUN apt-get update && apt-get install -y \ 8 git \ 9 python3 \ 10 make \ 11 g++ \ 12 && rm -rf /var/lib/apt/lists/* 13 14 # Create app directory 15 WORKDIR /usr/src/app 16 17 # Install dependencies 18 # A wildcard is used to ensure both package.json AND package-lock.json are copied 19 COPY package*.json ./ 20 21 RUN npm install 22 23 # Bundle app source 24 COPY . . 25 26 # Expose the port the app runs on 27 EXPOSE 3000 28 29 # Start command 30 CMD [ "node", "index.js" ]