add chromium
This commit is contained in:
parent
f24c3ff78f
commit
95e34ed172
13
Dockerfile
13
Dockerfile
@ -7,6 +7,8 @@ WORKDIR /app
|
||||
# 设置环境变量
|
||||
ENV PYTHONPATH=/app
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PLAYWRIGHT_BROWSERS_PATH=/usr
|
||||
ENV CHROME_PATH=/usr/bin/chromium
|
||||
|
||||
# 安装系统依赖
|
||||
RUN apt-get update && apt-get install -y \
|
||||
@ -15,6 +17,7 @@ RUN apt-get update && apt-get install -y \
|
||||
gnupg2 \
|
||||
ca-certificates \
|
||||
libpq-dev \
|
||||
chromium \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 安装Node.js (支持npx命令)
|
||||
@ -31,13 +34,9 @@ ENV PATH="/root/.cargo/bin:$PATH"
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# 安装 Python 版本 Playwright 并下载 Chromium
|
||||
RUN pip install --no-cache-dir playwright && \
|
||||
playwright install --with-deps chromium
|
||||
|
||||
# 安装 Node.js 版本 Playwright 并下载 Chromium
|
||||
RUN npm install -g playwright && \
|
||||
npx playwright install chromium
|
||||
# 安装 Playwright (使用系统 chromium,无需额外下载)
|
||||
RUN pip install --no-cache-dir playwright
|
||||
RUN npm install -g playwright
|
||||
|
||||
# 复制应用代码
|
||||
COPY . .
|
||||
|
||||
@ -7,6 +7,8 @@ WORKDIR /app
|
||||
# 设置环境变量
|
||||
ENV PYTHONPATH=/app
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PLAYWRIGHT_BROWSERS_PATH=/usr
|
||||
ENV CHROME_PATH=/usr/bin/chromium
|
||||
|
||||
# 安装系统依赖
|
||||
RUN sed -i 's|http://deb.debian.org|http://mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources && \
|
||||
@ -16,6 +18,7 @@ RUN sed -i 's|http://deb.debian.org|http://mirrors.aliyun.com|g' /etc/apt/source
|
||||
gnupg2 \
|
||||
ca-certificates \
|
||||
libpq-dev \
|
||||
chromium \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 安装Node.js (支持npx命令)
|
||||
@ -32,13 +35,9 @@ ENV PATH="/root/.cargo/bin:$PATH"
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ -r requirements.txt
|
||||
|
||||
# 安装 Python 版本 Playwright 并下载 Chromium
|
||||
RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ playwright && \
|
||||
playwright install --with-deps chromium
|
||||
|
||||
# 安装 Node.js 版本 Playwright 并下载 Chromium
|
||||
RUN npm install -g playwright && \
|
||||
npx playwright install chromium
|
||||
# 安装 Playwright (使用系统 chromium,无需额外下载)
|
||||
RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ playwright
|
||||
RUN npm install -g playwright
|
||||
|
||||
# 安装modelscope
|
||||
#RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ modelscope
|
||||
|
||||
Loading…
Reference in New Issue
Block a user