mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
refactor(browser): split browser cores via build ARG, add core selector (#237)
* refactor(browser): split browser cores via build ARG, add core selector - Replace playwright official image with ubuntu:noble base in both docker/Dockerfile.browser and devenv/Dockerfile.browser; install browsers at build time driven by ARG/ENV BROWSER_CORES - Add GET /cores endpoint to Browser Gateway reporting available cores - Proxy GET /browser-contexts/cores in Go handler to Browser Gateway - Add `core` field to BrowserContextConfigModel and GatewayBrowserContext; context creation selects the appropriate browser instance by core - Frontend context-setting page fetches available cores and renders a core selector; saves core as part of the config JSON - install.sh prompts for browser core selection and writes BROWSER_CORES to .env; builds the browser image locally before docker compose up - Regenerate OpenAPI spec and TypeScript SDK * fix: lint
This commit is contained in:
@@ -15,7 +15,10 @@ COPY apps/browser/ ./apps/browser/
|
||||
|
||||
RUN cd apps/browser && bun run build
|
||||
|
||||
FROM mcr.microsoft.com/playwright:v1.50.0-noble
|
||||
FROM ubuntu:noble
|
||||
|
||||
ARG BROWSER_CORES=chromium,firefox
|
||||
ENV BROWSER_CORES=$BROWSER_CORES
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -29,7 +32,9 @@ COPY --from=builder /build/apps/browser/node_modules /app/node_modules
|
||||
COPY --from=builder /build/apps/browser/package.json /app/package.json
|
||||
COPY --from=builder /build/node_modules /node_modules
|
||||
|
||||
RUN npx playwright install --with-deps chromium
|
||||
RUN for core in $(echo "$BROWSER_CORES" | tr ',' ' '); do \
|
||||
bun /app/node_modules/.bin/playwright install --with-deps "$core"; \
|
||||
done
|
||||
|
||||
EXPOSE 8083
|
||||
|
||||
|
||||
Reference in New Issue
Block a user