Playwright in Code Block #8250

Closed
opened 2026-02-21 18:24:42 -05:00 by yindo · 2 comments
Owner

Originally created by @JivinSardine on GitHub (Feb 13, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.0-beta.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Dockerfile.txt
this is the Dockerfile code and after building this:

Image

Image

✔️ Expected Behavior

Open a browser in headless mode and do given tasks.

Actual Behavior

Image

Originally created by @JivinSardine on GitHub (Feb 13, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.0.0-beta.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce [Dockerfile.txt](https://github.com/user-attachments/files/18785168/Dockerfile.txt) this is the Dockerfile code and after building this: ![Image](https://github.com/user-attachments/assets/10e480f4-415c-4a4e-a045-0afdfe90a4c5) ![Image](https://github.com/user-attachments/assets/02a75c77-f5d0-4f16-8b02-46c8a04d0d10) ### ✔️ Expected Behavior Open a browser in headless mode and do given tasks. ### ❌ Actual Behavior ![Image](https://github.com/user-attachments/assets/64a861a6-961d-4b87-a8c2-187a781ebc5e)
yindo closed this issue 2026-02-21 18:24:42 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 13, 2025):

I found a similar closed issue that might help you resolve the problem with missing system dependencies for Playwright in your Docker setup. The solution suggested was to run the command playwright install to ensure that the necessary Playwright browsers are installed. You can add this command to your Docker setup by modifying the entrypoint.sh script or directly in the Dockerfile. Here's how you can do it:

  1. Modify the entrypoint.sh script: Add the playwright install command to this script, which is executed when the container starts.

    # entrypoint.sh
    playwright install
    
  2. Add to the Dockerfile: Alternatively, include the playwright install command directly in the Dockerfile to ensure the necessary browsers are installed during the image build process.

    # Dockerfile
    RUN npx playwright install
    

After making these changes, rebuild your Docker image and restart your container using the updated image [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other | Bug Report

@dosubot[bot] commented on GitHub (Feb 13, 2025): <!-- Answer --> I found a similar closed issue that might help you resolve the problem with missing system dependencies for Playwright in your Docker setup. The solution suggested was to run the command `playwright install` to ensure that the necessary Playwright browsers are installed. You can add this command to your Docker setup by modifying the `entrypoint.sh` script or directly in the Dockerfile. Here's how you can do it: 1. **Modify the `entrypoint.sh` script**: Add the `playwright install` command to this script, which is executed when the container starts. ```sh # entrypoint.sh playwright install ``` 2. **Add to the Dockerfile**: Alternatively, include the `playwright install` command directly in the Dockerfile to ensure the necessary browsers are installed during the image build process. ```dockerfile # Dockerfile RUN npx playwright install ``` After making these changes, rebuild your Docker image and restart your container using the updated image <sup>[[1]](https://github.com/langgenius/dify/issues/13063)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/88af5ecf-506f-43e3-b056-0ac064a33453?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/88af5ecf-506f-43e3-b056-0ac064a33453?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/88af5ecf-506f-43e3-b056-0ac064a33453?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/88af5ecf-506f-43e3-b056-0ac064a33453?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/88af5ecf-506f-43e3-b056-0ac064a33453?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/88af5ecf-506f-43e3-b056-0ac064a33453?feedback_type=other) | [Bug Report](https://app.dosu.dev/response-feedback/88af5ecf-506f-43e3-b056-0ac064a33453?feedback_type=bug_report)</sup>
Author
Owner

@JivinSardine commented on GitHub (Feb 13, 2025):

I added it to the Dockerfile but no use. As I wanted to install using pip I used this:

`#Update conda and add necessary channels
RUN conda update -n base -c defaults conda &&
conda config --add channels conda-forge &&
conda config --add channels microsoft

#Install Playwright and pytest-playwright via conda
RUN conda install -y playwright pytest-playwright

(Optional) Install system dependencies for browsers automatically

RUN playwright install-deps

Install Playwright browsers

RUN playwright install`

still no luck.

@JivinSardine commented on GitHub (Feb 13, 2025): I added it to the Dockerfile but no use. As I wanted to install using pip I used this: `#Update conda and add necessary channels RUN conda update -n base -c defaults conda && \ conda config --add channels conda-forge && \ conda config --add channels microsoft #Install Playwright and pytest-playwright via conda RUN conda install -y playwright pytest-playwright # (Optional) Install system dependencies for browsers automatically RUN playwright install-deps # Install Playwright browsers RUN playwright install` still no luck.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8250