Reaperxxxx commited on
Commit
8c10019
·
verified ·
1 Parent(s): 0143367

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +52 -11
Dockerfile CHANGED
@@ -1,20 +1,61 @@
1
- # Use an official Node.js runtime
2
- FROM node:18-alpine
3
 
4
- # Set working directory inside container
5
- WORKDIR /app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
- # Copy package files first (for caching)
8
- COPY package.json ./
 
 
 
 
 
 
9
 
10
- # Install dependencies
11
- RUN npm install --production
 
 
 
 
 
12
 
13
  # Copy all files
14
  COPY . .
15
 
16
- # Expose the web port
 
 
 
 
 
 
17
  EXPOSE 7860
18
 
19
- # Start the server
20
- CMD ["npm", "start"]
 
1
+ # Base image with Node.js
2
+ FROM node:18
3
 
4
+ # Install ffmpeg
5
+ RUN apt-get update && apt-get install -y \
6
+ wget \
7
+ curl \
8
+ unzip \
9
+ fonts-liberation \
10
+ libasound2 \
11
+ libatk-bridge2.0-0 \
12
+ libatk1.0-0 \
13
+ libcups2 \
14
+ libdbus-1-3 \
15
+ libgbm-dev \
16
+ libnspr4 \
17
+ libnss3 \
18
+ libxcomposite1 \
19
+ libxdamage1 \
20
+ libxfixes3 \
21
+ libxrandr2 \
22
+ xdg-utils \
23
+ libu2f-udev \
24
+ libvulkan1 \
25
+ xvfb \
26
+ ca-certificates \
27
+ git \
28
+ --no-install-recommends && \
29
+ rm -rf /var/lib/apt/lists/*
30
 
31
+ RUN apt-get update && apt-get install -y \
32
+ coreutils \
33
+ && rm -rf /var/lib/apt/lists/*
34
+
35
+ RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /usr/share/keyrings/google-chrome-keyring.gpg \
36
+ && echo 'deb [signed-by=/usr/share/keyrings/google-chrome-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list \
37
+ && apt-get update \
38
+ && apt-get install -y google-chrome-stable
39
 
40
+ ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome \
41
+ PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
42
+ PUPPETEER_CACHE_DIR=/tmp/puppeteer_cache \
43
+ NODE_ENV=production
44
+
45
+ # Create app directory
46
+ WORKDIR /app
47
 
48
  # Copy all files
49
  COPY . .
50
 
51
+ # Set full permissions
52
+ RUN chmod -R 777 /app
53
+
54
+ # Install dependencies (no package.json, so specify manually)
55
+ RUN npm install express axios puppeteer crypto
56
+ RUN npx puppeteer install
57
+ # Expose port
58
  EXPOSE 7860
59
 
60
+ # Run the app
61
+ CMD ["node", "app.js"]