From 84a3e0a30b0f6b768e3e23c0114d8a226f891ef1 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Sat, 29 Mar 2025 16:36:02 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=88=20feat:=20=E6=9B=B4=E6=96=B0=20Doc?= =?UTF-8?q?kerfile=EF=BC=8C=E6=B7=BB=E5=8A=A0=20Node.js=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=B9=B6=E4=BC=98=E5=8C=96=E4=BE=9D=E8=B5=96=E5=AE=89?= =?UTF-8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 8 +++++--- Dockerfile_with_node | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 Dockerfile_with_node diff --git a/Dockerfile b/Dockerfile index 0b46d5d48..1b2314970 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,12 +9,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ python3-dev \ libffi-dev \ libssl-dev \ + ca-certificates \ + bash \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -RUN python -m pip install -r requirements.txt --no-cache-dir - -RUN python -m pip install socksio wechatpy cryptography --no-cache-dir +RUN python -m pip install uv +RUN uv pip install -r requirements.txt --no-cache-dir --system +RUN uv pip install socksio uv pyffmpeg --no-cache-dir --system EXPOSE 6185 EXPOSE 6186 diff --git a/Dockerfile_with_node b/Dockerfile_with_node new file mode 100644 index 000000000..3bd37468a --- /dev/null +++ b/Dockerfile_with_node @@ -0,0 +1,35 @@ +FROM python:3.10-slim + +WORKDIR /AstrBot + +COPY . /AstrBot/ + +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + build-essential \ + python3-dev \ + libffi-dev \ + libssl-dev \ + curl \ + unzip \ + ca-certificates \ + bash \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Installation of Node.js +ENV NVM_DIR="/root/.nvm" +RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash && \ + . "$NVM_DIR/nvm.sh" && \ + nvm install 22 && \ + nvm use 22 +RUN /bin/bash -c ". \"$NVM_DIR/nvm.sh\" && node -v && npm -v" + +RUN python -m pip install uv +RUN uv pip install -r requirements.txt --no-cache-dir --system +RUN uv pip install socksio uv pyffmpeg --no-cache-dir --system + +EXPOSE 6185 +EXPOSE 6186 + +CMD ["python", "main.py"]