Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up puppeteer in a docker environment using sail #14

Open
Joemires opened this issue Aug 18, 2024 · 3 comments
Open

Setting up puppeteer in a docker environment using sail #14

Joemires opened this issue Aug 18, 2024 · 3 comments

Comments

@Joemires
Copy link

Hello guys!
Please I need help with setting up my puppeteer in a docker environment
I'm using laravel sail and will appreciate having a container with chrome setup where I can connect my puppeteer to, I have seen someone do it with node, something like this:

chrome:
    image: 'browserless/chrome'
    ports: 
        - '${BROWSERLESS_CHROME_PORT:-3000}:3000'
    networks:
        - sail
    environment:
        - CONNECTION_TIMEOUT=-1       

later in the code

const browser = await puppeteer.connect({
    browserWSEndpoint: "ws://chrome:3000",
});
@dsebastien
Copy link

I'm also curious about this. @Joemires, did you manage to make it work?

@Joemires
Copy link
Author

Joemires commented Oct 6, 2024

Yes I did @dsebastien
Your docker compose configuration

chrome:
    image: 'browserless/chrome'
    ports: 
        - '${BROWSERLESS_CHROME_PORT:-3000}:3000'
    networks:
        - sail
    environment:
        - CONNECTION_TIMEOUT=-1       

later in the code

$client = $puppeteer->connect([
    'browserWSEndpoint' => env('BROWSER_WS_ENDPOINT') ?: 'ws://localhost:300'
]);

@Joemires
Copy link
Author

Joemires commented Oct 6, 2024

Yes I did @dsebastien Your docker compose configuration

chrome:
    image: 'browserless/chrome'
    ports: 
        - '${BROWSERLESS_CHROME_PORT:-3000}:3000'
    networks:
        - sail
    environment:
        - CONNECTION_TIMEOUT=-1       

later in the code

$client = $puppeteer->connect([
    'browserWSEndpoint' => env('BROWSER_WS_ENDPOINT') ?: 'ws://localhost:300'
]);

@dsebastien

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants