46 lines
981 B
Docker
46 lines
981 B
Docker
FROM node:20-slim
|
|
|
|
# Install system dependencies for Venom-bot, Puppeteer and Sharp
|
|
RUN apt-get update && apt-get install -y \
|
|
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/*
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# 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
|
|
COPY package.json yarn.lock ./
|
|
|
|
# Install project dependencies
|
|
RUN yarn install --frozen-lockfile --production=false
|
|
|
|
# Copy application files
|
|
COPY . .
|
|
|
|
# Expose the application port
|
|
EXPOSE 3001
|
|
|
|
# Start command
|
|
CMD ["yarn", "start"] |