This commit is contained in:
cangui 2025-05-06 20:16:52 +02:00
parent 8be64a0f81
commit d77d5724c3
2 changed files with 60 additions and 25 deletions

View File

@ -1,28 +1,46 @@
FROM node:20 FROM node:20-slim
# Installation des dépendances système nécessaires à sharp (et puppeteer) # Install system dependencies for Venom-bot, Puppeteer and Sharp
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
libvips-dev \ libvips-dev \
libnss3 \ libnss3 \
libatk-bridge2.0-0 \ libatk-bridge2.0-0 \
libxss1 \ libxss1 \
libasound2 \ libasound2 \
libgtk-3-0 \ libgtk-3-0 \
libgbm1 \ libgbm1 \
libx11-xcb1 \ libx11-xcb1 \
libxcomposite1 \ libxcomposite1 \
libxdamage1 \ libxdamage1 \
libxrandr2 \ libxrandr2 \
xdg-utils \ xdg-utils \
--no-install-recommends && \ fonts-liberation \
apt-get clean && rm -rf /var/lib/apt/lists/* libappindicator3-1 \
libnspr4 \
lsb-release \
wget \
# Clean up
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app WORKDIR /app
COPY package.json yarn.lock ./ # Install Chromium manually (recommended approach for Venom-bot)
RUN yarn install ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
# Copy package files first for better layer caching
COPY package.json yarn.lock ./
# Install project dependencies
RUN yarn install --frozen-lockfile --production=false
# Copy application files
COPY . . COPY . .
# Expose the application port
EXPOSE 3001 EXPOSE 3001
CMD ["yarn", "start"]
# Start command
CMD ["yarn", "start"]

View File

@ -1,10 +1,15 @@
{ {
"name": "baileys-whatsapp-api", "name": "whatsapp-api-venom",
"version": "1.0.0", "version": "2.0.1",
"description": "API WhatsApp avec Baileys Pro", "description": "API WhatsApp avec Venom-bot - Solution complète de messagerie",
"main": "index.js", "main": "server.js",
"scripts": { "scripts": {
"start": "node index.js" "start": "node server.js",
"dev": "nodemon server.js",
"test": "jest --coverage",
"lint": "eslint .",
"format": "prettier --write .",
"postinstall": "node node_modules/venom-bot/dist/install/install-chromium.js"
}, },
"dependencies": { "dependencies": {
"venom-bot": "^4.3.7", "venom-bot": "^4.3.7",
@ -16,5 +21,17 @@
"winston": "^3.11.0", "winston": "^3.11.0",
"axios": "^1.6.2", "axios": "^1.6.2",
"puppeteer": "^21.9.0" "puppeteer": "^21.9.0"
},
"devDependencies": {
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"jest": "^29.7.0",
"nodemon": "^3.0.2",
"prettier": "^3.1.1",
"supertest": "^6.3.3"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=8.0.0"
} }
} }