Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

get playwright version from pyproject.toml

Nick Sweeting6042184300b4
diff --git a/Dockerfile b/Dockerfile
index 6e538889b..73c5fd076 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -18,8 +18,9 @@ WORKDIR /app
# 5. Copy only dependency manifest
COPY pyproject.toml /app/
-# 6. Install patchright (version from pyproject.toml)
-RUN pip install playwright==$PLAYWRIGHT_VERSION
+# 6. Install playwright (version from pyproject.toml)
+RUN PLAYWRIGHT_VERSION=$(grep -oP '(p....right>=\K[0-9.]+' pyproject.toml)\
+ && pip install playwright==$PLAYWRIGHT_VERSION
# 7. Install Chromium via patchright
RUN playwright install --with-deps --no-shell chromium