Skip to content

Commit

Permalink
docs: use node 20 in docker examples
Browse files Browse the repository at this point in the history
  • Loading branch information
B4nan committed Jun 9, 2024
1 parent bfc1fa0 commit bf6d8ff
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion docs/guides/docker_browser_js.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Specify the base Docker image. You can read more about
# the available images at https://crawlee.dev/docs/guides/docker-images
# You can also use any other image from Docker Hub.
FROM apify/actor-node-playwright-chrome:16
FROM apify/actor-node-playwright-chrome:20

# Copy just package.json and package-lock.json
# to speed up the build using Docker layer cache.
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/docker_browser_ts.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Specify the base Docker image. You can read more about
# the available images at https://crawlee.dev/docs/guides/docker-images
# You can also use any other image from Docker Hub.
FROM apify/actor-node-playwright-chrome:16 AS builder
FROM apify/actor-node-playwright-chrome:20 AS builder

# Copy just package.json and package-lock.json
# to speed up the build using Docker layer cache.
Expand All @@ -19,7 +19,7 @@ COPY --chown=myuser . ./
RUN npm run build

# Create final image
FROM apify/actor-node-playwright-chrome:16
FROM apify/actor-node-playwright-chrome:20

# Copy only built JS files from builder image
COPY --from=builder --chown=myuser /home/myuser/dist ./dist
Expand Down
24 changes: 12 additions & 12 deletions docs/guides/docker_images.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ Each image is tagged with up to 2 version tags, depending on the type of the ima
Our images are built with multiple Node.js versions to ensure backwards compatibility. Currently, Node.js **versions 16 and 18 are supported** (legacy versions still exist, see DockerHub). To select the preferred version, use the appropriate number as the image tag.

```dockerfile
# Use Node.js 16
FROM apify/actor-node:16
# Use Node.js 20
FROM apify/actor-node:20
```

### Automation library versioning

Images that include a pre-installed automation library, which means all images that include `puppeteer` or `playwright` in their name, are also tagged with the pre-installed version of the library. For example, `apify/actor-node-puppeteer-chrome:16-13.7.0` comes with Node.js 16 and Puppeteer v13.7.0. If you try to install a different version of Puppeteer into this image, you may run into compatibility issues, because the Chromium version bundled with `puppeteer` will not match the version of Chromium that's pre-installed.
Images that include a pre-installed automation library, which means all images that include `puppeteer` or `playwright` in their name, are also tagged with the pre-installed version of the library. For example, `apify/actor-node-puppeteer-chrome:20-22.1.0` comes with Node.js 20 and Puppeteer v22.1.0. If you try to install a different version of Puppeteer into this image, you may run into compatibility issues, because the Chromium version bundled with `puppeteer` will not match the version of Chromium that's pre-installed.

Similarly `apify/actor-node-playwright-firefox:14-1.21.1` runs on Node.js 14 and is pre-installed with the Firefox version that comes with v1.21.1.

Expand All @@ -59,12 +59,12 @@ We also build pre-release versions of the images to test the changes we make. Th

```dockerfile
# Without library version.
FROM apify/actor-node:16-beta
FROM apify/actor-node:20-beta
```

```dockerfile
# With library version.
FROM apify/actor-node-playwright-chrome:16-1.10.0-beta
FROM apify/actor-node-playwright-chrome:20-1.10.0-beta
```

## Best practices
Expand All @@ -76,7 +76,7 @@ FROM apify/actor-node-playwright-chrome:16-1.10.0-beta
It makes sure the pre-installed version of Puppeteer or Playwright is not re-installed on build. This is important, because those libraries are only guaranteed to work with specific versions of browsers, and those browsers come pre-installed in the image.

```dockerfile
FROM apify/actor-node-playwright-chrome:16
FROM apify/actor-node-playwright-chrome:20
```

```json
Expand Down Expand Up @@ -105,7 +105,7 @@ This is the smallest image we have based on Alpine Linux. It does not include an
&#8203;<ApiLink to="puppeteer-crawler/class/PuppeteerCrawler">`PuppeteerCrawler`</ApiLink>, <ApiLink to="playwright-crawler/class/PlaywrightCrawler">`PlaywrightCrawler`</ApiLink> and other browser based features will **NOT** work with this image.

```dockerfile
FROM apify/actor-node:16
FROM apify/actor-node:20
```

### actor-node-puppeteer-chrome
Expand All @@ -115,15 +115,15 @@ This image includes Puppeteer (Chromium) and the Chrome browser. It can be used
The image supports XVFB by default, so you can run both `headless` and `headful` browsers with it.

```dockerfile
FROM apify/actor-node-puppeteer-chrome:16
FROM apify/actor-node-puppeteer-chrome:20
```

### actor-node-playwright

A very large and slow image that can run all Playwright browsers: Chromium, Chrome, Firefox, WebKit. Everything is installed. If you need to develop or test with multiple browsers, this is the image to choose, but in most cases, it's better to use the specialized images below.

```dockerfile
FROM apify/actor-node-playwright:16
FROM apify/actor-node-playwright:20
```

### actor-node-playwright-chrome
Expand All @@ -135,7 +135,7 @@ It uses the [`PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD`](https://playwright.dev/docs/api
The image supports XVFB by default, so we can run both `headless` and `headful` browsers with it.

```dockerfile
FROM apify/actor-node-playwright-chrome:16
FROM apify/actor-node-playwright-chrome:20
```

### actor-node-playwright-firefox
Expand All @@ -144,7 +144,7 @@ Same idea as [`actor-node-playwright-chrome`](#actor-node-playwright-chrome), bu
pre-installed.

```dockerfile
FROM apify/actor-node-playwright-firefox:16
FROM apify/actor-node-playwright-firefox:20
```

### actor-node-playwright-webkit
Expand All @@ -153,7 +153,7 @@ Same idea as [`actor-node-playwright-chrome`](#actor-node-playwright-chrome), bu
pre-installed.

```dockerfile
FROM apify/actor-node-playwright-webkit:16
FROM apify/actor-node-playwright-webkit:20
```

## Example Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/docker_node_js.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Specify the base Docker image. You can read more about
# the available images at https://crawlee.dev/docs/guides/docker-images
# You can also use any other image from Docker Hub.
FROM apify/actor-node:16
FROM apify/actor-node:20

# Copy just package.json and package-lock.json
# to speed up the build using Docker layer cache.
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/docker_node_ts.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Specify the base Docker image. You can read more about
# the available images at https://crawlee.dev/docs/guides/docker-images
# You can also use any other image from Docker Hub.
FROM apify/actor-node:16 AS builder
FROM apify/actor-node:20 AS builder

# Copy just package.json and package-lock.json
# to speed up the build using Docker layer cache.
Expand All @@ -19,7 +19,7 @@ COPY . ./
RUN npm run build

# Create final image
FROM apify/actor-node:16
FROM apify/actor-node:20

# Copy only built JS files from builder image
COPY --from=builder /usr/src/app/dist ./dist
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/typescript_project.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ For `Dockerfile` we recommend using multi-stage build, so we don't install the d

```dockerfile title="Dockerfile"
# using multistage build, as we need dev deps to build the TS source code
FROM apify/actor-node:16 AS builder
FROM apify/actor-node:20 AS builder
# copy all files, install all dependencies (including dev deps) and build the project
COPY . ./
RUN npm install --include=dev \
&& npm run build
# create final image
FROM apify/actor-node:16
FROM apify/actor-node:20
# copy only necessary files
COPY --from=builder /usr/src/app/package*.json ./
COPY --from=builder /usr/src/app/dist ./dist
Expand Down
4 changes: 2 additions & 2 deletions docs/upgrading/upgrading_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ For `Dockerfile` we recommend using multi-stage build, so you don't install the

```dockerfile title="Dockerfile"
# using multistage build, as we need dev deps to build the TS source code
FROM apify/actor-node:16 AS builder
FROM apify/actor-node:20 AS builder

# copy all files, install all dependencies (including dev deps) and build the project
COPY . ./
RUN npm install --include=dev \
&& npm run build

# create final image
FROM apify/actor-node:16
FROM apify/actor-node:20
# copy only necessary files
COPY --from=builder /usr/src/app/package*.json ./
COPY --from=builder /usr/src/app/README.md ./
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Specify the base Docker image. You can read more about
# the available images at https://crawlee.dev/docs/guides/docker-images
# You can also use any other image from Docker Hub.
FROM apify/actor-node-playwright-chrome:16
FROM apify/actor-node-playwright-chrome:20

# Copy just package.json and package-lock.json
# to speed up the build using Docker layer cache.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Specify the base Docker image. You can read more about
# the available images at https://crawlee.dev/docs/guides/docker-images
# You can also use any other image from Docker Hub.
FROM apify/actor-node-playwright-chrome:16 AS builder
FROM apify/actor-node-playwright-chrome:20 AS builder

# Copy just package.json and package-lock.json
# to speed up the build using Docker layer cache.
Expand All @@ -19,7 +19,7 @@ COPY --chown=myuser . ./
RUN npm run build

# Create final image
FROM apify/actor-node-playwright-chrome:16
FROM apify/actor-node-playwright-chrome:20

# Copy only built JS files from builder image
COPY --from=builder --chown=myuser /home/myuser/dist ./dist
Expand Down
24 changes: 12 additions & 12 deletions website/versioned_docs/version-3.10/guides/docker_images.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ Each image is tagged with up to 2 version tags, depending on the type of the ima
Our images are built with multiple Node.js versions to ensure backwards compatibility. Currently, Node.js **versions 16 and 18 are supported** (legacy versions still exist, see DockerHub). To select the preferred version, use the appropriate number as the image tag.

```dockerfile
# Use Node.js 16
FROM apify/actor-node:16
# Use Node.js 20
FROM apify/actor-node:20
```

### Automation library versioning

Images that include a pre-installed automation library, which means all images that include `puppeteer` or `playwright` in their name, are also tagged with the pre-installed version of the library. For example, `apify/actor-node-puppeteer-chrome:16-13.7.0` comes with Node.js 16 and Puppeteer v13.7.0. If you try to install a different version of Puppeteer into this image, you may run into compatibility issues, because the Chromium version bundled with `puppeteer` will not match the version of Chromium that's pre-installed.
Images that include a pre-installed automation library, which means all images that include `puppeteer` or `playwright` in their name, are also tagged with the pre-installed version of the library. For example, `apify/actor-node-puppeteer-chrome:20-22.1.0` comes with Node.js 20 and Puppeteer v22.1.0. If you try to install a different version of Puppeteer into this image, you may run into compatibility issues, because the Chromium version bundled with `puppeteer` will not match the version of Chromium that's pre-installed.

Similarly `apify/actor-node-playwright-firefox:14-1.21.1` runs on Node.js 14 and is pre-installed with the Firefox version that comes with v1.21.1.

Expand All @@ -59,12 +59,12 @@ We also build pre-release versions of the images to test the changes we make. Th

```dockerfile
# Without library version.
FROM apify/actor-node:16-beta
FROM apify/actor-node:20-beta
```

```dockerfile
# With library version.
FROM apify/actor-node-playwright-chrome:16-1.10.0-beta
FROM apify/actor-node-playwright-chrome:20-1.10.0-beta
```

## Best practices
Expand All @@ -76,7 +76,7 @@ FROM apify/actor-node-playwright-chrome:16-1.10.0-beta
It makes sure the pre-installed version of Puppeteer or Playwright is not re-installed on build. This is important, because those libraries are only guaranteed to work with specific versions of browsers, and those browsers come pre-installed in the image.

```dockerfile
FROM apify/actor-node-playwright-chrome:16
FROM apify/actor-node-playwright-chrome:20
```

```json
Expand Down Expand Up @@ -105,7 +105,7 @@ This is the smallest image we have based on Alpine Linux. It does not include an
&#8203;<ApiLink to="puppeteer-crawler/class/PuppeteerCrawler">`PuppeteerCrawler`</ApiLink>, <ApiLink to="playwright-crawler/class/PlaywrightCrawler">`PlaywrightCrawler`</ApiLink> and other browser based features will **NOT** work with this image.

```dockerfile
FROM apify/actor-node:16
FROM apify/actor-node:20
```

### actor-node-puppeteer-chrome
Expand All @@ -115,15 +115,15 @@ This image includes Puppeteer (Chromium) and the Chrome browser. It can be used
The image supports XVFB by default, so you can run both `headless` and `headful` browsers with it.

```dockerfile
FROM apify/actor-node-puppeteer-chrome:16
FROM apify/actor-node-puppeteer-chrome:20
```

### actor-node-playwright

A very large and slow image that can run all Playwright browsers: Chromium, Chrome, Firefox, WebKit. Everything is installed. If you need to develop or test with multiple browsers, this is the image to choose, but in most cases, it's better to use the specialized images below.

```dockerfile
FROM apify/actor-node-playwright:16
FROM apify/actor-node-playwright:20
```

### actor-node-playwright-chrome
Expand All @@ -135,7 +135,7 @@ It uses the [`PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD`](https://playwright.dev/docs/api
The image supports XVFB by default, so we can run both `headless` and `headful` browsers with it.

```dockerfile
FROM apify/actor-node-playwright-chrome:16
FROM apify/actor-node-playwright-chrome:20
```

### actor-node-playwright-firefox
Expand All @@ -144,7 +144,7 @@ Same idea as [`actor-node-playwright-chrome`](#actor-node-playwright-chrome), bu
pre-installed.

```dockerfile
FROM apify/actor-node-playwright-firefox:16
FROM apify/actor-node-playwright-firefox:20
```

### actor-node-playwright-webkit
Expand All @@ -153,7 +153,7 @@ Same idea as [`actor-node-playwright-chrome`](#actor-node-playwright-chrome), bu
pre-installed.

```dockerfile
FROM apify/actor-node-playwright-webkit:16
FROM apify/actor-node-playwright-webkit:20
```

## Example Dockerfile
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Specify the base Docker image. You can read more about
# the available images at https://crawlee.dev/docs/guides/docker-images
# You can also use any other image from Docker Hub.
FROM apify/actor-node:16
FROM apify/actor-node:20

# Copy just package.json and package-lock.json
# to speed up the build using Docker layer cache.
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-3.10/guides/docker_node_ts.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Specify the base Docker image. You can read more about
# the available images at https://crawlee.dev/docs/guides/docker-images
# You can also use any other image from Docker Hub.
FROM apify/actor-node:16 AS builder
FROM apify/actor-node:20 AS builder

# Copy just package.json and package-lock.json
# to speed up the build using Docker layer cache.
Expand All @@ -19,7 +19,7 @@ COPY . ./
RUN npm run build

# Create final image
FROM apify/actor-node:16
FROM apify/actor-node:20

# Copy only built JS files from builder image
COPY --from=builder /usr/src/app/dist ./dist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ For `Dockerfile` we recommend using multi-stage build, so we don't install the d

```dockerfile title="Dockerfile"
# using multistage build, as we need dev deps to build the TS source code
FROM apify/actor-node:16 AS builder
FROM apify/actor-node:20 AS builder
# copy all files, install all dependencies (including dev deps) and build the project
COPY . ./
RUN npm install --include=dev \
&& npm run build
# create final image
FROM apify/actor-node:16
FROM apify/actor-node:20
# copy only necessary files
COPY --from=builder /usr/src/app/package*.json ./
COPY --from=builder /usr/src/app/dist ./dist
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-3.10/upgrading/upgrading_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ For `Dockerfile` we recommend using multi-stage build, so you don't install the

```dockerfile title="Dockerfile"
# using multistage build, as we need dev deps to build the TS source code
FROM apify/actor-node:16 AS builder
FROM apify/actor-node:20 AS builder

# copy all files, install all dependencies (including dev deps) and build the project
COPY . ./
RUN npm install --include=dev \
&& npm run build

# create final image
FROM apify/actor-node:16
FROM apify/actor-node:20
# copy only necessary files
COPY --from=builder /usr/src/app/package*.json ./
COPY --from=builder /usr/src/app/README.md ./
Expand Down

0 comments on commit bf6d8ff

Please sign in to comment.