Skip to content

Commit 4b42c49

Browse files
authored
Fix: using pnpm from corepack when install dependency (#762)
* feat: use pnpm from corepack to install dependency Since package.json already has the packageManager field specified with pnpm and its specific version, there is no reason not to use it during whole dev/build process. * feat: use npmmirror in Dockerfile * feat: install pnpm through mirror * feat(Dockerfile): set apt-get mirror
1 parent 2152916 commit 4b42c49

File tree

3 files changed

+8
-4002
lines changed

3 files changed

+8
-4002
lines changed

.github/workflows/gh-pages.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,8 @@ jobs:
7474
uses: actions/setup-node@v4
7575
with:
7676
node-version: '20'
77-
78-
- uses: pnpm/action-setup@v3
79-
name: Install pnpm
80-
with:
81-
version: 8
82-
run_install: false
77+
- name: Enable corepack
78+
run: corepack enable
8379

8480
- name: Get pnpm store directory
8581
shell: bash

Dockerfile

+6-8
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
FROM python:3.10.5-slim AS develop-py
33
WORKDIR /root/running_page
44
COPY ./requirements.txt /root/running_page/requirements.txt
5-
# Add proxy for apt.
6-
# ENV http_proxy http://ip_address:port
7-
# ENV https_proxy http://ip_address:port
8-
RUN apt-get update \
5+
RUN sed -i 's@http://archive.ubuntu.com/ubuntu/@https://mirrors.tuna.tsinghua.edu.cn/ubuntu/@g' /etc/apt/sources.list \
6+
&& sed -i 's@http://security.ubuntu.com/ubuntu/@https://mirrors.tuna.tsinghua.edu.cn/ubuntu/@g' /etc/apt/sources.list \
7+
&& apt-get update \
98
&& apt-get install -y --no-install-recommends git \
109
&& apt-get purge -y --auto-remove \
1110
&& rm -rf /var/lib/apt/lists/* \
@@ -17,10 +16,9 @@ FROM node:18 AS develop-node
1716
WORKDIR /root/running_page
1817
COPY ./package.json /root/running_page/package.json
1918
COPY ./pnpm-lock.yaml /root/running_page/pnpm-lock.yaml
20-
RUN npm config rm proxy&&npm config set registry https://registry.npmjs.org/ \
21-
&&npm install -g corepack \
22-
&&corepack enable \
23-
&&pnpm install
19+
RUN npm config set registry https://registry.npmmirror.com \
20+
&& corepack enable \
21+
&& COREPACK_NPM_REGISTRY=https://registry.npmmirror.com pnpm install
2422

2523
FROM develop-py AS data
2624
ARG app

0 commit comments

Comments
 (0)