fix chromium

This commit is contained in:
felinae98 2021-02-08 11:39:57 +08:00
parent 2178f9667f
commit 8d02c8f22a
No known key found for this signature in database
GPG Key ID: 00C8B010587FF610
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
FROM python:3.9
RUN echo "deb http://mirrors.aliyun.com/debian/ buster main contrib non-free\ndeb http://mirrors.aliyun.com/debian/ buster-updates main contrib non-free" > /etc/apt/sources.list && \
apt-get update && apt-get install -y fonts-wqy-microhei
apt-get update && apt-get install -y fonts-wqy-microhei chromium
RUN python3 -m pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
RUN python3 -m pip install poetry && poetry config virtualenvs.create false
WORKDIR /app

View File

@ -21,9 +21,9 @@ class Render(metaclass=Singleton):
async def init(self):
if plugin_config.hk_reporter_use_local:
browser = await launch(executablePath='/usr/bin/chromium')
browser = await launch(executablePath='/usr/bin/chromium', args=['--no-sandbox'])
else:
browser = await launch()
browser = await launch(args=['--no-sandbox'])
self.page = await browser.newPage()
async def text_to_pic(self, text: str) -> str: