Merge pull request #31 from NepPure/feat/docker编译性能优化

docker编译性能优化
pull/36/head
HYY 2025-03-03 11:25:04 +08:00 committed by GitHub
commit 955d2672ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 3 deletions

6
.dockerignore 100644
View File

@ -0,0 +1,6 @@
.git
__pycache__
*.pyc
*.pyo
*.pyd
.DS_Store

View File

@ -1,8 +1,18 @@
FROM nonebot/nb-cli:latest
WORKDIR /
COPY . /MaiMBot/
# 设置工作目录
WORKDIR /MaiMBot
# 先复制依赖列表
COPY requirements.txt .
# 安装依赖这层会被缓存直到requirements.txt改变
RUN pip install --upgrade -r requirements.txt
# 然后复制项目代码
COPY . .
VOLUME [ "/MaiMBot/config" ]
VOLUME [ "/MaiMBot/data" ]
EXPOSE 8080
ENTRYPOINT [ "nb","run" ]
ENTRYPOINT [ "nb","run" ]