mirror of
https://github.com/Xtao-Labs/QQ-GitHub-Bot.git
synced 2025-01-30 15:08:54 +00:00
🐳 update dependencies and dockerfile
This commit is contained in:
parent
3d3f57eb0a
commit
92255fdb2f
31
Dockerfile
31
Dockerfile
@ -1,5 +1,21 @@
|
|||||||
|
FROM python:3.8 as requirements-stage
|
||||||
|
|
||||||
|
WORKDIR /tmp
|
||||||
|
|
||||||
|
COPY ./pyproject.toml ./poetry.lock* /tmp/
|
||||||
|
|
||||||
|
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -o install-poetry.py
|
||||||
|
|
||||||
|
RUN python install-poetry.py --yes
|
||||||
|
|
||||||
|
ENV PATH="${PATH}:/root/.local/bin"
|
||||||
|
|
||||||
|
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes
|
||||||
|
|
||||||
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8
|
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
ENV LANG zh_CN.UTF-8
|
ENV LANG zh_CN.UTF-8
|
||||||
ENV LANGUAGE zh_CN.UTF-8
|
ENV LANGUAGE zh_CN.UTF-8
|
||||||
ENV LC_ALL zh_CN.UTF-8
|
ENV LC_ALL zh_CN.UTF-8
|
||||||
@ -20,20 +36,19 @@ RUN apt-get update && apt-get install -y locales locales-all fonts-noto
|
|||||||
|
|
||||||
# RUN python3 -m pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
|
# 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
|
COPY --from=requirements-stage /tmp/requirements.txt /app/requirements.txt
|
||||||
|
|
||||||
COPY ./ /app/
|
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
||||||
|
|
||||||
RUN poetry export --without-hashes -f requirements.txt \
|
RUN echo "Install playwright headless browser..." \
|
||||||
| poetry run pip install -r /dev/stdin \
|
&& playwright install chromium \
|
||||||
&& echo "Install playwright headless browser..." \
|
|
||||||
&& poetry run playwright install chromium \
|
|
||||||
&& apt-get install -y libnss3-dev libxss1 libasound2 libxrandr2\
|
&& apt-get install -y libnss3-dev libxss1 libasound2 libxrandr2\
|
||||||
libatk1.0-0 libgtk-3-0 libgbm-dev libxshmfence1\
|
libatk1.0-0 libgtk-3-0 libgbm-dev libxshmfence1
|
||||||
&& poetry install --no-dev
|
|
||||||
|
|
||||||
# RUN echo "Install wkhtmltox renderer..." \
|
# RUN echo "Install wkhtmltox renderer..." \
|
||||||
# && chmod +x ./scripts/download_wkhtmltox.sh \
|
# && chmod +x ./scripts/download_wkhtmltox.sh \
|
||||||
# && ./scripts/download_wkhtmltox.sh buster_amd64 \
|
# && ./scripts/download_wkhtmltox.sh buster_amd64 \
|
||||||
# && apt-get install -y xvfb ./wkhtmltox_*.deb\
|
# && apt-get install -y xvfb ./wkhtmltox_*.deb\
|
||||||
# && rm wkhtmltox_*.deb
|
# && rm wkhtmltox_*.deb
|
||||||
|
|
||||||
|
COPY ./ /app/
|
||||||
|
929
poetry.lock
generated
929
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,7 @@ license = "MIT"
|
|||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.8"
|
python = "^3.8"
|
||||||
psutil = "^5.7.2"
|
psutil = "^5.7.2"
|
||||||
httpx = "^0.18.0"
|
httpx = "^0.19.0"
|
||||||
Jinja2 = "^3.0.0"
|
Jinja2 = "^3.0.0"
|
||||||
unidiff = "^0.6.0"
|
unidiff = "^0.6.0"
|
||||||
humanize = "^3.5.0"
|
humanize = "^3.5.0"
|
||||||
@ -24,8 +24,8 @@ redis = {version = "^3.5.3", extras = ["hiredis"]}
|
|||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
isort = "^5.9.3"
|
isort = "^5.9.3"
|
||||||
black = "^21.8b0"
|
black = "^21.8b0"
|
||||||
|
nb-cli = "^0.5.0"
|
||||||
# nonebot-plugin-test = "^0.2.0"
|
# nonebot-plugin-test = "^0.2.0"
|
||||||
nb-cli = {version = "^0.5.0", extras = ["deploy"]}
|
|
||||||
|
|
||||||
# [[tool.poetry.source]]
|
# [[tool.poetry.source]]
|
||||||
# name = "aliyun"
|
# name = "aliyun"
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
@Author : yanyongyu
|
@Author : yanyongyu
|
||||||
@Date : 2021-03-12 13:42:43
|
@Date : 2021-03-12 13:42:43
|
||||||
@LastEditors : yanyongyu
|
@LastEditors : yanyongyu
|
||||||
@LastEditTime : 2021-03-25 16:17:09
|
@LastEditTime : 2021-11-01 14:05:41
|
||||||
@Description : None
|
@Description : None
|
||||||
@GitHub : https://github.com/yanyongyu
|
@GitHub : https://github.com/yanyongyu
|
||||||
"""
|
"""
|
||||||
__author__ = "yanyongyu"
|
__author__ = "yanyongyu"
|
||||||
|
|
||||||
from typing import Optional, Generator
|
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
|
from typing import Optional, AsyncIterator
|
||||||
|
|
||||||
from playwright.async_api import Page, Browser, async_playwright
|
from playwright.async_api import Page, Browser, async_playwright
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ async def get_browser(**kwargs) -> Browser:
|
|||||||
|
|
||||||
|
|
||||||
@asynccontextmanager
|
@asynccontextmanager
|
||||||
async def get_new_page(**kwargs) -> Generator[Page, None, None]:
|
async def get_new_page(**kwargs) -> AsyncIterator[Page]:
|
||||||
browser = await get_browser()
|
browser = await get_browser()
|
||||||
page = await browser.new_page(**kwargs)
|
page = await browser.new_page(**kwargs)
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user