mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-06 20:06:12 +08:00
update Dockerfile, docker-compose, fix #95
This commit is contained in:
parent
319e7401ed
commit
49909e9750
@ -2,7 +2,7 @@ version: '3'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
go-cqhttp:
|
go-cqhttp:
|
||||||
image: felinae98/go-cqhttp:v1.0.0-beta8-fix2
|
image: silicer/go-cqhttp:v1.0.0-rc3
|
||||||
volumes:
|
volumes:
|
||||||
- ./bot-data:/data
|
- ./bot-data:/data
|
||||||
nonebot:
|
nonebot:
|
||||||
@ -15,10 +15,9 @@ services:
|
|||||||
# SUPERUSERS: '[<your QQ>]'
|
# SUPERUSERS: '[<your QQ>]'
|
||||||
BISON_CONFIG_PATH: /data
|
BISON_CONFIG_PATH: /data
|
||||||
# BISON_OUTER_URL: 'http://<your server ip>:8080/bison'
|
# BISON_OUTER_URL: 'http://<your server ip>:8080/bison'
|
||||||
BISON_FILTER_LOG: true
|
BISON_FILTER_LOG: 'true'
|
||||||
BISON_USE_PIC: false # 如果需要将文字转为图片发送请改为true
|
BISON_USE_PIC: 'false' # 如果需要将文字转为图片发送请改为true
|
||||||
|
ports:
|
||||||
expose:
|
|
||||||
- 8080:8080
|
- 8080:8080
|
||||||
depends_on:
|
depends_on:
|
||||||
- go-cqhttp
|
- go-cqhttp
|
||||||
|
@ -1,17 +1,22 @@
|
|||||||
FROM python:3.9
|
# syntax=docker/dockerfile:1.2
|
||||||
RUN python3 -m pip install poetry && poetry config virtualenvs.create false
|
FROM python:3.9 as base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN apt-get update && apt-get install -y xvfb fonts-noto-color-emoji ttf-unifont \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
|
python3 -m pip install poetry && poetry config virtualenvs.create false
|
||||||
|
RUN --mount=type=cache,target=/var/cache/apt \
|
||||||
|
--mount=type=cache,target=/var/lib/apt \
|
||||||
|
apt-get update && apt-get install -y xvfb fonts-noto-color-emoji ttf-unifont \
|
||||||
libfontconfig1 libfreetype6 xfonts-cyrillic xfonts-scalable fonts-liberation \
|
libfontconfig1 libfreetype6 xfonts-cyrillic xfonts-scalable fonts-liberation \
|
||||||
fonts-ipafont-gothic fonts-wqy-zenhei fonts-tlwg-loma-otf \
|
fonts-ipafont-gothic fonts-wqy-zenhei fonts-tlwg-loma-otf \
|
||||||
fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 \
|
fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 \
|
||||||
libcairo2 libcups2 libdbus-1-3 libdrm2 libegl1 libgbm1 libglib2.0-0 libgtk-3-0 \
|
libcairo2 libcups2 libdbus-1-3 libdrm2 libegl1 libgbm1 libglib2.0-0 libgtk-3-0 \
|
||||||
libnspr4 libnss3 libpango-1.0-0 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
|
libnspr4 libnss3 libpango-1.0-0 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
|
||||||
libxdamage1 libxext6 libxfixes3 libxrandr2 libxshmfence1 \
|
libxdamage1 libxext6 libxfixes3 libxrandr2 libxshmfence1
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
COPY ./pyproject.toml ./poetry.lock* /app/
|
COPY ./pyproject.toml ./poetry.lock* /app/
|
||||||
RUN poetry install --no-dev --no-root
|
RUN --mount=type=cache,target=/root/.cache/pypoetry \
|
||||||
RUN playwright install chromium
|
poetry install --no-dev --no-root
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/ms-playwright \
|
||||||
|
playwright install chromium
|
||||||
ADD src /app/src
|
ADD src /app/src
|
||||||
ADD bot.py /app/
|
ADD bot.py /app/
|
||||||
ENV HOST=0.0.0.0
|
ENV HOST=0.0.0.0
|
||||||
|
@ -1,19 +1,25 @@
|
|||||||
FROM python:3.9
|
# syntax=docker/dockerfile:1.2
|
||||||
RUN python3 -m pip install poetry && poetry config virtualenvs.create false
|
FROM python:3.9 as base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN apt-get update && apt-get install -y xvfb fonts-noto-color-emoji ttf-unifont \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
|
python3 -m pip install poetry && poetry config virtualenvs.create false
|
||||||
|
RUN --mount=type=cache,target=/var/cache/apt \
|
||||||
|
--mount=type=cache,target=/var/lib/apt \
|
||||||
|
apt-get update && apt-get install -y xvfb fonts-noto-color-emoji ttf-unifont \
|
||||||
libfontconfig1 libfreetype6 xfonts-cyrillic xfonts-scalable fonts-liberation \
|
libfontconfig1 libfreetype6 xfonts-cyrillic xfonts-scalable fonts-liberation \
|
||||||
fonts-ipafont-gothic fonts-wqy-zenhei fonts-tlwg-loma-otf \
|
fonts-ipafont-gothic fonts-wqy-zenhei fonts-tlwg-loma-otf \
|
||||||
fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 \
|
fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 \
|
||||||
libcairo2 libcups2 libdbus-1-3 libdrm2 libegl1 libgbm1 libglib2.0-0 libgtk-3-0 \
|
libcairo2 libcups2 libdbus-1-3 libdrm2 libegl1 libgbm1 libglib2.0-0 libgtk-3-0 \
|
||||||
libnspr4 libnss3 libpango-1.0-0 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
|
libnspr4 libnss3 libpango-1.0-0 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
|
||||||
libxdamage1 libxext6 libxfixes3 libxrandr2 libxshmfence1 \
|
libxdamage1 libxext6 libxfixes3 libxrandr2 libxshmfence1
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
COPY ./pyproject.toml ./poetry.lock* ./bot.py /app/
|
COPY ./pyproject.toml ./poetry.lock* ./bot.py /app/
|
||||||
RUN poetry add nonebot-plugin-sentry && \
|
RUN --mount=type=cache,target=/root/.cache/pypoetry \
|
||||||
|
poetry add nonebot-plugin-sentry && \
|
||||||
sed '/nonebot.load_builtin_plugins("echo")/a nonebot.load_plugin("nonebot_plugin_sentry")' -i bot.py
|
sed '/nonebot.load_builtin_plugins("echo")/a nonebot.load_plugin("nonebot_plugin_sentry")' -i bot.py
|
||||||
RUN poetry install --no-dev --no-root
|
RUN --mount=type=cache,target=/root/.cache/pypoetry \
|
||||||
RUN playwright install chromium
|
poetry install --no-dev --no-root
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/ms-playwright \
|
||||||
|
playwright install chromium
|
||||||
ADD src /app/src
|
ADD src /app/src
|
||||||
ENV HOST=0.0.0.0
|
ENV HOST=0.0.0.0
|
||||||
CMD ["python", "bot.py"]
|
CMD ["python", "bot.py"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user