whatsapp/Dockerfile

46 lines
981 B
Docker
Raw Normal View History

2025-05-06 18:16:52 +00:00
FROM node:20-slim
2025-05-06 08:51:13 +00:00
2025-05-06 18:16:52 +00:00
# Install system dependencies for Venom-bot, Puppeteer and Sharp
2025-05-06 09:59:56 +00:00
RUN apt-get update && apt-get install -y \
2025-05-06 18:16:52 +00:00
libvips-dev \
libnss3 \
libatk-bridge2.0-0 \
libxss1 \
libasound2 \
libgtk-3-0 \
libgbm1 \
libx11-xcb1 \
libxcomposite1 \
libxdamage1 \
libxrandr2 \
xdg-utils \
fonts-liberation \
libappindicator3-1 \
libnspr4 \
lsb-release \
wget \
# Clean up
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
2025-05-06 12:42:08 +00:00
2025-05-06 18:16:52 +00:00
# Set working directory
2025-05-06 12:42:08 +00:00
WORKDIR /app
2025-05-06 18:16:52 +00:00
# Install Chromium manually (recommended approach for Venom-bot)
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
# Copy package files first for better layer caching
2025-05-06 12:42:08 +00:00
COPY package.json yarn.lock ./
2025-05-06 18:16:52 +00:00
# Install project dependencies
RUN yarn install --frozen-lockfile --production=false
# Copy application files
2025-05-06 12:42:08 +00:00
COPY . .
2025-05-06 09:59:56 +00:00
2025-05-06 18:16:52 +00:00
# Expose the application port
2025-05-06 09:59:56 +00:00
EXPOSE 3001
2025-05-06 18:16:52 +00:00
# Start command
CMD ["yarn", "start"]