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:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"setup-worktree": [
|
||||
"npm install"
|
||||
"pnpm install"
|
||||
]
|
||||
}
|
||||
|
||||
+11
-9
@@ -10,7 +10,7 @@ steps:
|
||||
image: docker-mirror.ravanertebat.ir/hub/node:22.14
|
||||
|
||||
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_AUDIT: false
|
||||
commands:
|
||||
@@ -28,15 +28,17 @@ steps:
|
||||
|
||||
- mkdir -p ./artifacts/node
|
||||
- rm -rf .git
|
||||
- npx npm config list
|
||||
- npx npm install --loglevel=verbose
|
||||
- corepack enable
|
||||
- corepack prepare pnpm@10.18.0 --activate
|
||||
- pnpm config list
|
||||
- rm -rf dist
|
||||
- npm ci --loglevel=verbose
|
||||
- npm run test:e2e --loglevel=verbose
|
||||
- npm run build
|
||||
- cp .next/standalone ./artifacts/node/standalone
|
||||
- cp .next/static ./artifacts/node/static
|
||||
- cp ./public ./artifacts/node/public
|
||||
- pnpm install --frozen-lockfile --reporter=append-only
|
||||
- pnpm run test:e2e
|
||||
- pnpm run build
|
||||
- cp -R .next/standalone/. ./artifacts/node/
|
||||
- mkdir -p ./artifacts/node/.next
|
||||
- cp -R .next/static ./artifacts/node/.next/static
|
||||
- cp -R ./public ./artifacts/node/public
|
||||
- ls -ltrh ./artifacts/node
|
||||
|
||||
- name: build panel
|
||||
|
||||
+21
-5
@@ -1,14 +1,30 @@
|
||||
FROM docker-mirror.ravanertebat.ir/hub/node:22.14 AS base
|
||||
|
||||
|
||||
FROM docker-mirror.ravanertebat.ir/hub/node:22.14
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="${PNPM_HOME}:${PATH}"
|
||||
|
||||
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
|
||||
|
||||
COPY ./artifacts/node/ ./
|
||||
|
||||
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
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
|
||||
@@ -16,28 +16,23 @@ By leveraging the latest features of **Next.js 14** and key functionalities like
|
||||
|
||||
## 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**!
|
||||
|
||||
## Highlighted Features
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "free-nextadmin-nextjs",
|
||||
"version": "1.2.1",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@10.18.0",
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"dev:e2e": "next dev -p 3000",
|
||||
|
||||
Reference in New Issue
Block a user