diff --git a/Dockerfile b/Dockerfile index 6ff6f00..a28977c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,6 +45,17 @@ RUN git clone https://github.com/Sahith59/OverLeaf_MCP.git . \ # --------------------------------------------------------------- RUN npx playwright install chromium +# --------------------------------------------------------------- +# 5. Force headless mode in the built code +# The source launches Playwright with headless:false (designed +# for desktop). We patch the compiled JS to force headless:true. +# --------------------------------------------------------------- +RUN find /app/dist -name '*.js' -exec sed -i \ + -e 's/headless:\s*false/headless:true/g' \ + -e 's/headless:!1/headless:true/g' \ + -e "s/headless:!0/headless:true/g" \ + {} + + # --------------------------------------------------------------- # 5. Create data directories # ---------------------------------------------------------------