Reaperxxxx commited on
Commit
46afeb9
·
verified ·
1 Parent(s): a469773

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +51 -0
Dockerfile ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Node.js runtime as a base image
2
+ FROM node:18-bullseye
3
+
4
+ # Set working directory inside the container
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies required for Playwright
8
+ RUN apt-get update && apt-get install -y \
9
+ wget \
10
+ curl \
11
+ unzip \
12
+ fonts-liberation \
13
+ libasound2 \
14
+ libatk-bridge2.0-0 \
15
+ libatk1.0-0 \
16
+ libcups2 \
17
+ libdbus-1-3 \
18
+ libgbm-dev \
19
+ libnspr4 \
20
+ libnss3 \
21
+ libxcomposite1 \
22
+ libxdamage1 \
23
+ libxfixes3 \
24
+ libxrandr2 \
25
+ xdg-utils \
26
+ libu2f-udev \
27
+ libvulkan1 \
28
+ xvfb \
29
+ --no-install-recommends && \
30
+ rm -rf /var/lib/apt/lists/*
31
+
32
+ # Set environment variable for Playwright browsers path
33
+ ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
34
+
35
+ # Copy package.json and package-lock.json first for caching
36
+ COPY package.json ./
37
+
38
+ # Install project dependencies
39
+ RUN npm install
40
+
41
+ # Install Playwright browsers
42
+ RUN npx playwright install --with-deps chromium
43
+
44
+ # Copy the application source code
45
+ COPY . .
46
+
47
+ # Expose the port
48
+ EXPOSE 7860
49
+
50
+ # Start the application (REMOVE playwright install from CMD)
51
+ CMD ["node", "server.js"]