From 3007f67cabbcc670a350bd3e54443479b48264d4 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Thu, 2 Oct 2025 16:59:11 +0800 Subject: [PATCH] fix: update Dockerfile to remove npm installation and streamline package setup closes: #2284 --- .gitignore | 4 +++- Dockerfile | 21 ++++++++------------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 14e6bf8cb..8006fef89 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,6 @@ packages/python_interpreter/workplace .conda/ .idea pytest.ini -.astrbot \ No newline at end of file +.astrbot + +uv.lock \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 0430be002..df48b2be2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,6 @@ WORKDIR /AstrBot COPY . /AstrBot/ RUN apt-get update && apt-get install -y --no-install-recommends \ - nodejs \ - npm \ gcc \ build-essential \ python3-dev \ @@ -13,23 +11,20 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libssl-dev \ ca-certificates \ bash \ + ffmpeg \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y curl gnupg && \ + curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \ + apt-get install -y nodejs && \ + rm -rf /var/lib/apt/lists/* + RUN python -m pip install uv RUN uv pip install -r requirements.txt --no-cache-dir --system -RUN uv pip install socksio uv pyffmpeg pilk --no-cache-dir --system +RUN uv pip install socksio uv pilk --no-cache-dir --system -# 释出 ffmpeg -RUN python -c "from pyffmpeg import FFmpeg; ff = FFmpeg();" - -# add /root/.pyffmpeg/bin/ffmpeg to PATH, inorder to use ffmpeg -RUN echo 'export PATH=$PATH:/root/.pyffmpeg/bin' >> ~/.bashrc - -EXPOSE 6185 +EXPOSE 6185 EXPOSE 6186 CMD [ "python", "main.py" ] - - -