mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-07-03 05:23:29 +00:00
docker build -t genshinuid:v3.1.0 . nonebot 在 /nb2/nb2,GenshinUID 在 /plugin,需要的可自行挂载(用 docker volume) 默认不带有 go-cqhttp 及 nonebot-plugin-gocqhttp 插件,暴露端口 8080,需要自己连接 go-cqhttp build 前修改 deploy 文件夹下的 .env.dev 修改镜像的 nonebot2 配置,或者可以运行后挂载 nb2 目录修改
44 lines
958 B
Docker
44 lines
958 B
Docker
FROM python:3.9
|
|
|
|
# 1. 环境设置
|
|
|
|
# 使用镜像源
|
|
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
|
|
|
|
RUN apt-get update && apt-get install -y tzdata
|
|
|
|
ENV TZ Asia/Shanghai
|
|
|
|
# 2. 安装 GenshinUID
|
|
WORKDIR /plugin
|
|
|
|
COPY ./pyproject.toml ./LICENSE ./README.md /plugin/
|
|
|
|
COPY ./GenshinUID /plugin/GenshinUID/
|
|
|
|
RUN pip install --editable "."
|
|
|
|
COPY ./.git /plugin/.git
|
|
|
|
# 3. 生成 nb2 项目
|
|
WORKDIR /nb2
|
|
|
|
RUN pip install tomlkit "cookiecutter>=2.1.1"
|
|
|
|
COPY ./deploy/cookiecutter.yml ./deploy/update_pyproject.py /nb2/
|
|
|
|
# RUN cookiecutter --config-file ./cookiecutter.yml https://github.com/nonebot/nb-cli.git --directory="nb_cli/project" --no-input
|
|
# 使用镜像源
|
|
RUN cookiecutter --config-file ./cookiecutter.yml https://ghproxy.com/https://github.com/nonebot/nb-cli.git --directory="nb_cli/project" --no-input
|
|
|
|
RUN python update_pyproject.py
|
|
|
|
COPY ./deploy/.env.dev /nb2/nb2/
|
|
|
|
WORKDIR /nb2/nb2
|
|
|
|
EXPOSE 8080
|
|
|
|
|
|
CMD python bot.py
|