Docker: python slim + Debian chromium via CHROME_PATH

mcr.microsoft.com Playwright image pulls get reset on the Dokploy server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
VasanthandClaude Opus 5.5 committed 2026-10-27 17:40:05 +05:30
1 parent fd480fa874
commit c7094b694f
2 files changed
+14 -6

No files matched your search

+5 -2
View File
@@ -262,11 +262,14 @@ def run_site(site, locations):
failed = []
seen = {} # file content -> location; two locations with identical exports = stale data
with sync_playwright() as p:
# server/Docker: HEADLESS=1 and CHROME_CHANNEL="" (Playwright's bundled Chromium)
# server/Docker: HEADLESS=1 and CHROME_PATH=/usr/bin/chromium (Debian package)
headless = os.environ.get("HEADLESS") == "1"
chrome_path = os.environ.get("CHROME_PATH")
ctx = p.chromium.launch_persistent_context(
str(ROOT / f".chrome_profile_{site.lower()}"),
channel=os.environ.get("CHROME_CHANNEL", "chrome") or None, headless=headless,
executable_path=chrome_path or None,
channel=None if chrome_path else os.environ.get("CHROME_CHANNEL", "chrome") or None,
headless=headless,
accept_downloads=True, no_viewport=not headless,
viewport={"width": 1440, "height": 900} if headless else None,
)