KilersBotz commited on
Commit
796ab61
·
verified ·
1 Parent(s): f5736d0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -26
Dockerfile CHANGED
@@ -1,34 +1,35 @@
1
- FROM node:20-slim
2
 
3
- # Install deps Chromium (biar yang di-download Puppeteer bisa jalan)
4
- RUN apt-get update && apt-get install -y \
5
- chromium \
6
- fonts-liberation \
7
- libasound2 \
8
- libatk1.0-0 \
9
- libcups2 \
10
- libdbus-1-3 \
11
- libdrm2 \
12
- libgbm1 \
13
- libgtk-3-0 \
14
- libnspr4 \
15
- libnss3 \
16
- libx11-6 \
17
- libx11-xcb1 \
18
- libxcomposite1 \
19
- libxdamage1 \
20
- libxrandr2 \
21
- libxss1 \
22
- libxtst6 \
23
- wget \
24
- --no-install-recommends && \
25
- apt-get clean && rm -rf /var/lib/apt/lists/*
26
 
 
 
 
27
 
28
  WORKDIR /app
29
- RUN npm install
30
  COPY . .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
 
32
  EXPOSE 7860
33
 
34
- CMD ["node", "index.js"]
 
 
1
+ FROM mcr.microsoft.com/playwright:focal
2
 
3
+ # Skip Playwright browser downloads
4
+ ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
+ # Set timezone
7
+ ENV TZ=Asia/Jakarta
8
+ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
9
 
10
  WORKDIR /app
11
+
12
  COPY . .
13
+ # Install dependencies
14
+ RUN npm install
15
+
16
+ # Install Playwright dependencies and browsers
17
+ RUN npx playwright install --with-deps
18
+
19
+ # Install additional dependencies for fonts
20
+ RUN apt-get update && apt-get install -y \
21
+ wget \
22
+ fontconfig \
23
+ fonts-noto-color-emoji \
24
+ fontconfig \
25
+ --no-install-recommends && \
26
+ rm -rf /var/lib/apt/lists/*
27
+
28
+ # Set environment variable for the app port
29
+ ENV PORT=7860
30
 
31
+ # Expose the port
32
  EXPOSE 7860
33
 
34
+ # Start the application
35
+ CMD ["node", "index.js"]