Update Dockerfile
Browse files- Dockerfile +6 -3
Dockerfile
CHANGED
|
@@ -45,14 +45,17 @@ RUN apt-get update && \
|
|
| 45 |
# Set the working directory
|
| 46 |
WORKDIR /app
|
| 47 |
|
|
|
|
|
|
|
|
|
|
| 48 |
# Copy package configuration files
|
| 49 |
COPY package.json package-lock.json ./
|
| 50 |
|
| 51 |
-
# Install dependencies.
|
| 52 |
-
# download a compatible version of Chromium into the container.
|
| 53 |
RUN npm ci --omit=dev
|
| 54 |
|
| 55 |
-
# Explicitly install the Chrome browser for Puppeteer
|
|
|
|
| 56 |
RUN npx puppeteer browsers install chrome
|
| 57 |
|
| 58 |
# Copy the rest of your application source code
|
|
|
|
| 45 |
# Set the working directory
|
| 46 |
WORKDIR /app
|
| 47 |
|
| 48 |
+
# Set Puppeteer's cache directory to a location within the app directory
|
| 49 |
+
ENV PUPPETEER_CACHE_DIR=/app/.cache/puppeteer
|
| 50 |
+
|
| 51 |
# Copy package configuration files
|
| 52 |
COPY package.json package-lock.json ./
|
| 53 |
|
| 54 |
+
# Install dependencies. Puppeteer will automatically download Chromium to the specified cache directory.
|
|
|
|
| 55 |
RUN npm ci --omit=dev
|
| 56 |
|
| 57 |
+
# Explicitly install the Chrome browser for Puppeteer (optional, but good for explicit control)
|
| 58 |
+
# This command will now use the PUPPETEER_CACHE_DIR
|
| 59 |
RUN npx puppeteer browsers install chrome
|
| 60 |
|
| 61 |
# Copy the rest of your application source code
|