diff --git a/Dockerfile b/Dockerfile index f1ec957ef..e2d36efea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,15 +18,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \ - apt-get install -y --no-install-recommends nodejs && \ - echo "3.11" > .python-version && \ - 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 && \ -RUN python -m pip install --no-cache-dir uv && \ - uv pip install socksio pilk --no-cache-dir --system +RUN python -m pip install uv +RUN uv pip install -r requirements.txt --no-cache-dir --system +RUN uv pip install socksio uv pilk --no-cache-dir --system EXPOSE 6185 -EXPOSE 6186 -CMD ["uv", "run", "main.py"] +CMD ["python", "main.py"] diff --git a/Dockerfile_with_node b/Dockerfile_with_node deleted file mode 100644 index 1f0b3a749..000000000 --- a/Dockerfile_with_node +++ /dev/null @@ -1,40 +0,0 @@ -FROM python:3.11-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 \ - git \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -ENV NVM_DIR="/root/.nvm" \ - NODE_VERSION=22 -RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash && \ - . "$NVM_DIR/nvm.sh" && \ - nvm install $NODE_VERSION && \ - nvm use $NODE_VERSION && \ - nvm alias default $NODE_VERSION && \ - node -v && npm -v && \ - echo "3.11" > .python-version -ENV PATH="$NVM_DIR/versions/node/v$(node -v | cut -d 'v' -f 2)/bin:$PATH" - -RUN python -m pip install --no-cache-dir uv - -# 安装项目依赖(根据指南,使用 uv sync) -RUN uv sync --no-cache - -EXPOSE 6185 -EXPOSE 6186 - -CMD ["uv", "run", "main.py"] \ No newline at end of file