refactor(docker): 重构容器化配置,移除冗余服务并迁移至 uv 包管理
- 精简 Dockerfile:删除 lpmm 编译步骤,改用 pyproject.toml 与 uv sync - 移除 docker-compose 中的 adapters、sqlite-web 服务,仅保留 core 与 napcat - 统一工作目录与卷挂载路径,由 /MaiMBot 更名为 /InkFox - 网络名称由 maim_bot 改为 mofox - 入口命令切换为 uv run,提升启动速度与依赖隔离
This commit is contained in:
20
Dockerfile
20
Dockerfile
@@ -2,31 +2,19 @@ FROM python:3.13.5-slim-bookworm
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
||||
|
||||
# 工作目录
|
||||
WORKDIR /mmc
|
||||
WORKDIR /app
|
||||
|
||||
# 复制依赖列表
|
||||
COPY requirements.txt .
|
||||
# 同级目录下需要有 maim_message MaiMBot-LPMM
|
||||
#COPY maim_message /maim_message
|
||||
COPY MaiMBot-LPMM /MaiMBot-LPMM
|
||||
COPY pyproject.toml .
|
||||
|
||||
# 编译器
|
||||
RUN apt-get update && apt-get install -y build-essential
|
||||
|
||||
# lpmm编译安装
|
||||
RUN cd /MaiMBot-LPMM && uv pip install --system -r requirements.txt
|
||||
RUN uv pip install --system Cython py-cpuinfo setuptools
|
||||
RUN cd /MaiMBot-LPMM/lib/quick_algo && python build_lib.py --cleanup --cythonize --install
|
||||
|
||||
|
||||
# 安装依赖
|
||||
RUN uv pip install --system --upgrade pip
|
||||
#RUN uv pip install --system -e /maim_message
|
||||
RUN uv pip install --system -r requirements.txt
|
||||
|
||||
# 复制项目代码
|
||||
RUN uv sync
|
||||
COPY . .
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
ENTRYPOINT [ "python","bot.py" ]
|
||||
ENTRYPOINT [ "uv","run","bot.py" ]
|
||||
Reference in New Issue
Block a user