File size: 1,222 Bytes
23e7811
 
47c662c
23e7811
 
 
 
47c662c
23e7811
 
 
 
 
 
47c662c
23e7811
 
 
 
 
47c662c
 
 
 
 
23e7811
 
 
 
 
 
47c662c
23e7811
 
47c662c
23e7811
0f719b2
47c662c
23e7811
0216d6e
47c662c
23e7811
 
 
 
47c662c
 
23e7811
 
 
dc82946
 
23e7811
 
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
48
49
50
51
52
53
54
# Use an official Node.js runtime as a base image
FROM node:18-bullseye

# Set working directory inside the container
WORKDIR /app

# Install system dependencies required for Playwright
RUN apt-get update && apt-get install -y \
    wget \
    curl \
    unzip \
    fonts-liberation \
    libasound2 \
    libatk-bridge2.0-0 \
    libatk1.0-0 \
    libcups2 \
    libdbus-1-3 \
    libgbm-dev \
    libnspr4 \
    libnss3 \
    libxcomposite1 \
    libxdamage1 \
    libxfixes3 \
    libxrandr2 \
    xdg-utils \
    libu2f-udev \
    libvulkan1 \
    xvfb \
    chromium \
    --no-install-recommends && \
    rm -rf /var/lib/apt/lists/*

# Set environment variable for Playwright browsers path
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright

# Copy package.json and package-lock.json first for caching
COPY package.json ./

# Install project dependencies
RUN npm install && npm install express-prettify prettyjson chalk

# Install Playwright browsers
RUN npx playwright install --with-deps chromium

# Copy the application source code
COPY . .

RUN mkdir -p /app/downloads && chmod -R 777 /app/downloads

# Expose the port
EXPOSE 7860

# Start the application (REMOVE playwright install from CMD)
CMD ["node", "server.js"]