thor1242 commited on
Commit
6bba44a
·
verified ·
1 Parent(s): d63ef15

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -6
Dockerfile CHANGED
@@ -1,16 +1,23 @@
1
  FROM node:18-bullseye-slim
2
 
3
- # 1. Install utilities to download Google's keys (wget, gnupg)
 
4
  RUN apt-get update && apt-get install -y \
5
  wget \
6
  gnupg \
 
7
  --no-install-recommends
8
 
9
- # 2. Add Google's signing key and repository
10
- RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
11
- && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
 
12
 
13
- # 3. Install System Dependencies (FFmpeg, Xvfb, Chrome, Fonts)
 
 
 
 
14
  RUN apt-get update && apt-get install -y \
15
  ffmpeg \
16
  xvfb \
@@ -29,8 +36,10 @@ RUN apt-get update && apt-get install -y \
29
  WORKDIR /app
30
 
31
  # Copy package.json and install node dependencies
32
- # We set PUPPETEER_SKIP_CHROMIUM_DOWNLOAD to true because we installed Chrome manually above
33
  ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
 
 
34
  COPY package.json ./
35
  RUN npm install
36
 
 
1
  FROM node:18-bullseye-slim
2
 
3
+ # 1. Install utilities and certificates
4
+ # We need ca-certificates so wget can talk to https sites
5
  RUN apt-get update && apt-get install -y \
6
  wget \
7
  gnupg \
8
+ ca-certificates \
9
  --no-install-recommends
10
 
11
+ # 2. Add Google's signing key safely
12
+ # We download the key, dearmor it, and save it to a specific keyring location
13
+ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub \
14
+ | gpg --dearmor -o /usr/share/keyrings/google-chrome-keyring.gpg
15
 
16
+ # 3. Add the Google Repository referencing the key
17
+ RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" \
18
+ > /etc/apt/sources.list.d/google-chrome.list
19
+
20
+ # 4. Install System Dependencies (FFmpeg, Xvfb, Chrome, Fonts)
21
  RUN apt-get update && apt-get install -y \
22
  ffmpeg \
23
  xvfb \
 
36
  WORKDIR /app
37
 
38
  # Copy package.json and install node dependencies
39
+ # Skip chromium download since we installed it manually
40
  ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
41
+ ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome
42
+
43
  COPY package.json ./
44
  RUN npm install
45