full-greenF
Apify & Crawlee3y ago
12 replies
full-green

The basic app works, but breaks in docker

Hello there! I've just started creating a project and followed the steps from the guide. The basic TS project created with npx crawlee create and playwright crawler works, however when I try to dockerize this app using the guide from https://crawlee.dev/docs/guides/docker-images it doesn't work.
The only change I've done is that I've created a docker compose file with the following contents to make it a bit easier for me.
version: '3.8'

services:
  demoapp:
    build:
      dockerfile: Dockerfile
    ports:
      - "8080:8080"


When I try to launch it, I get the following error:

 ! demoapp The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 

INFO  PlaywrightCrawler: Starting the crawler.
node:internal/process/esm_loader:108
    internalBinding('errors').triggerUncaughtException(
                              ^

Failed to launch browser. Please check the following:
- Try installing the required dependencies by running `npx playwright install --with-deps` (https://playwright.dev/docs/browsers).

The original error is available in the `cause` property. Below is the error received when trying to launch a browser:

browserType.launchPersistentContext: Target page, context or browser has been closed
Browser logs:
[...]

[cause]: browserType.launchPersistentContext: Target page, context or browser has been closed


Am I doing something wrong? Is it something wrong with the image? Is it not possible to run on mac with ARM and I need to emulate x64?
Example Docker images to run your crawlers
Running in Docker | Crawlee
Was this page helpful?