Spaces:
Sleeping
Sleeping
File size: 972 Bytes
59033e3 02e64e8 3fb8c0b 59033e3 3fb8c0b 59033e3 3fb8c0b 8b8d09a 3fb8c0b 8b8d09a 59033e3 3fb8c0b bc16320 3fb8c0b 59033e3 3fb8c0b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | # Use a Node.js base image
FROM node:18
# Set working directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm install
# Install Puppeteer and Chromium as dependencies
RUN npm install puppeteer chromium
# Install required dependencies (like libx11) for Puppeteer to run headless Chromium
RUN apt-get update && apt-get install -y \
wget \
ca-certificates \
fonts-liberation \
libappindicator3-1 \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libcups2 \
libdbus-1-3 \
libgdk-pixbuf2.0-0 \
libnspr4 \
libnss3 \
libx11-xcb1 \
libxcomposite1 \
libxdamage1 \
libxrandr2 \
xdg-utils \
&& rm -rf /var/lib/apt/lists/*
# Log Chromium installation path
RUN echo "Chromium path: $(npm explore chromium -- npm bin)"
# Copy the rest of the application
COPY . .
# Expose the port
EXPOSE 7860
# Command to run the app
CMD ["node", "server.js"] |