fix: add missing dockerfile deps
This commit is contained in:
parent
fcd21dc871
commit
6b6b9f8a6a
@ -1,4 +1,4 @@
|
|||||||
FROM denoland/deno:alpine-2.1.4
|
FROM denoland/deno:2.1.4
|
||||||
|
|
||||||
ENV DATA_DIR=/app/data
|
ENV DATA_DIR=/app/data
|
||||||
|
|
||||||
@ -6,8 +6,7 @@ WORKDIR /app
|
|||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN apk add curl libstdc++ gtk+3.0 alsa-lib &&\
|
RUN deno run -A npm:playwright install --with-deps firefox &&\
|
||||||
deno run -A npm:playwright install chromium-headless-shell &&\
|
|
||||||
deno install --allow-import --allow-ffi --allow-scripts=npm:sharp@0.33.5-rc.1 -e main.ts &&\
|
deno install --allow-import --allow-ffi --allow-scripts=npm:sharp@0.33.5-rc.1 -e main.ts &&\
|
||||||
sed -i -e 's/"deno"/"no-deno"/' node_modules/@libsql/client/package.json &&\
|
sed -i -e 's/"deno"/"no-deno"/' node_modules/@libsql/client/package.json &&\
|
||||||
mkdir -p $DATA_DIR
|
mkdir -p $DATA_DIR
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { chromium } from "npm:playwright-extra";
|
import { firefox } from "npm:playwright-extra";
|
||||||
import { createStreamResponse } from "@lib/helpers.ts";
|
import { createStreamResponse } from "@lib/helpers.ts";
|
||||||
import StealthPlugin from "npm:puppeteer-extra-plugin-stealth";
|
import StealthPlugin from "npm:puppeteer-extra-plugin-stealth";
|
||||||
|
|
||||||
@ -9,7 +9,7 @@ const userAgentStrings = [
|
|||||||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36",
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36",
|
||||||
];
|
];
|
||||||
|
|
||||||
chromium.use(StealthPlugin());
|
firefox.use(StealthPlugin());
|
||||||
|
|
||||||
export async function fetchHtmlWithPlaywright(
|
export async function fetchHtmlWithPlaywright(
|
||||||
fetchUrl: string,
|
fetchUrl: string,
|
||||||
@ -17,7 +17,7 @@ export async function fetchHtmlWithPlaywright(
|
|||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
streamResponse.enqueue("booting up playwright");
|
streamResponse.enqueue("booting up playwright");
|
||||||
// Launch the Playwright browser
|
// Launch the Playwright browser
|
||||||
const browser = await chromium.launch();
|
const browser = await firefox.launch();
|
||||||
|
|
||||||
streamResponse.enqueue("fetching html");
|
streamResponse.enqueue("fetching html");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user