Use .nvmrc and avoid installing nvm in container since we only need node & npm there. (#2499)
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -132,7 +132,7 @@ jobs:
|
|||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version-file: .nvmrc
|
||||||
|
|
||||||
- name: Install Node.js dependencies
|
- name: Install Node.js dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|||||||
2
.github/workflows/n8n-ci.yml
vendored
2
.github/workflows/n8n-ci.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
|||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version-file: .nvmrc
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v2
|
uses: pnpm/action-setup@v2
|
||||||
|
|||||||
21
Dockerfile
21
Dockerfile
@@ -16,20 +16,15 @@ RUN playwright install-deps
|
|||||||
RUN playwright install
|
RUN playwright install
|
||||||
RUN apt-get install -y xauth x11-apps netpbm curl && apt-get clean
|
RUN apt-get install -y xauth x11-apps netpbm curl && apt-get clean
|
||||||
|
|
||||||
# nvm env vars
|
COPY .nvmrc /app/.nvmrc
|
||||||
RUN mkdir -p /usr/local/nvm
|
# Install Node.js based on .nvmrc version (without nvm)
|
||||||
ENV NVM_DIR /usr/local/nvm
|
RUN NODE_MAJOR=$(cut -d. -f1 < /app/.nvmrc) && \
|
||||||
ENV NODE_VERSION v20.12.2
|
curl --fail --silent --show-error --location https://deb.nodesource.com/setup_${NODE_MAJOR}.x | bash - && \
|
||||||
# install nvm
|
apt-get install -y nodejs && \
|
||||||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
apt-get clean
|
||||||
# install node and npm
|
|
||||||
RUN /bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm use --delete-prefix $NODE_VERSION"
|
|
||||||
# add node and npm to the PATH
|
|
||||||
ENV NODE_PATH $NVM_DIR/versions/node/$NODE_VERSION/bin
|
|
||||||
ENV PATH $NODE_PATH:$PATH
|
|
||||||
# confirm installation
|
# confirm installation
|
||||||
RUN npm -v
|
RUN npm -v && node -v
|
||||||
RUN node -v
|
|
||||||
# install bitwarden cli
|
# install bitwarden cli
|
||||||
RUN npm install -g @bitwarden/cli@2024.9.0
|
RUN npm install -g @bitwarden/cli@2024.9.0
|
||||||
# checking bw version also initializes the bw config
|
# checking bw version also initializes the bw config
|
||||||
|
|||||||
Reference in New Issue
Block a user