chore: migrate to pnpm for package management and update CI configuration

- Replaced npm with pnpm in the CI configuration and Dockerfile for improved dependency management.
- Updated package.json to specify pnpm as the package manager.
- Modified installation instructions in README.md to reflect the use of pnpm.
- Enhanced the build process in the Dockerfile to utilize pnpm for installing dependencies and building the application.
This commit is contained in:
AmirReza Jamali
2026-04-25 15:20:23 +03:30
parent 9b3bd3d1f5
commit 84d34866be
5 changed files with 41 additions and 27 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
{ {
"setup-worktree": [ "setup-worktree": [
"npm install" "pnpm install"
] ]
} }
+11 -9
View File
@@ -10,7 +10,7 @@ steps:
image: docker-mirror.ravanertebat.ir/hub/node:22.14 image: docker-mirror.ravanertebat.ir/hub/node:22.14
environment: environment:
NPM_CONFIG_REGISTRY: https://mirror.ravanertebat.ir/repository/npm-proxy/ PNPM_CONFIG_REGISTRY: https://mirror.ravanertebat.ir/repository/npm-proxy/
#NPM_CONFIG_STRICT_SSL: false #NPM_CONFIG_STRICT_SSL: false
#NPM_CONFIG_AUDIT: false #NPM_CONFIG_AUDIT: false
commands: commands:
@@ -28,15 +28,17 @@ steps:
- mkdir -p ./artifacts/node - mkdir -p ./artifacts/node
- rm -rf .git - rm -rf .git
- npx npm config list - corepack enable
- npx npm install --loglevel=verbose - corepack prepare pnpm@10.18.0 --activate
- pnpm config list
- rm -rf dist - rm -rf dist
- npm ci --loglevel=verbose - pnpm install --frozen-lockfile --reporter=append-only
- npm run test:e2e --loglevel=verbose - pnpm run test:e2e
- npm run build - pnpm run build
- cp .next/standalone ./artifacts/node/standalone - cp -R .next/standalone/. ./artifacts/node/
- cp .next/static ./artifacts/node/static - mkdir -p ./artifacts/node/.next
- cp ./public ./artifacts/node/public - cp -R .next/static ./artifacts/node/.next/static
- cp -R ./public ./artifacts/node/public
- ls -ltrh ./artifacts/node - ls -ltrh ./artifacts/node
- name: build panel - name: build panel
+21 -5
View File
@@ -1,14 +1,30 @@
FROM docker-mirror.ravanertebat.ir/hub/node:22.14 AS base
ENV PNPM_HOME="/pnpm"
FROM docker-mirror.ravanertebat.ir/hub/node:22.14 ENV PATH="${PNPM_HOME}:${PATH}"
WORKDIR /app WORKDIR /app
RUN corepack enable
FROM base AS deps
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
FROM base AS builder
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN pnpm run build
FROM docker-mirror.ravanertebat.ir/hub/node:22.14 AS runner
WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production
COPY ./artifacts/node/ ./
ENV HOSTNAME="0.0.0.0" ENV HOSTNAME="0.0.0.0"
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public
EXPOSE 3000 EXPOSE 3000
CMD ["node", "server.js"] CMD ["node", "server.js"]
+7 -12
View File
@@ -16,28 +16,23 @@ By leveraging the latest features of **Next.js 14** and key functionalities like
## Installation ## Installation
1. Download/fork/clone the repo and Once you're in the correct directory, it's time to install all the necessary dependencies. You can do this by typing the following command: 1. Download/fork/clone the repo and once you're in the correct directory, install all dependencies with:
``` ```
npm install pnpm install
``` ```
If you're using **Yarn** as your package manager, the command will be: If `pnpm` is not already available on your machine, enable it via Corepack first:
``` ```
yarn install corepack enable
corepack prepare pnpm@10.18.0 --activate
``` ```
2. Okay, you're almost there. Now all you need to do is start the development server. If you're using **npm**, the command is: 2. Start the development server:
``` ```
npm run dev pnpm dev
``` ```
And if you're using **Yarn**, it's:
```
yarn dev
```
And voila! You're now ready to start developing. **Happy coding**! And voila! You're now ready to start developing. **Happy coding**!
## Highlighted Features ## Highlighted Features
+1
View File
@@ -2,6 +2,7 @@
"name": "free-nextadmin-nextjs", "name": "free-nextadmin-nextjs",
"version": "1.2.1", "version": "1.2.1",
"private": true, "private": true,
"packageManager": "pnpm@10.18.0",
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
"dev:e2e": "next dev -p 3000", "dev:e2e": "next dev -p 3000",