diff --git a/.cursor/worktrees.json b/.cursor/worktrees.json index 77e9744..e57556b 100644 --- a/.cursor/worktrees.json +++ b/.cursor/worktrees.json @@ -1,5 +1,5 @@ { "setup-worktree": [ - "npm install" + "pnpm install" ] } diff --git a/.drone.yml b/.drone.yml index 5e474b5..53177d7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index d7e89d9..2ce719b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index e4da6d6..2c30fe4 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package.json b/package.json index d27dd21..6639ef6 100644 --- a/package.json +++ b/package.json @@ -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",