diff --git a/tools/walletextension/frontend/Dockerfile b/tools/walletextension/frontend/Dockerfile index 341bf8efdf..95c722a985 100644 --- a/tools/walletextension/frontend/Dockerfile +++ b/tools/walletextension/frontend/Dockerfile @@ -1,9 +1,9 @@ # Use an official Node.js LTS version as a base image FROM node:20-alpine AS base + # Install pnpm RUN npm install -g pnpm - ARG NEXT_PUBLIC_NETWORK_NAME ARG NEXT_PUBLIC_TENSCAN_URL ARG NEXT_PUBLIC_GATEWAY_URL @@ -21,7 +21,7 @@ WORKDIR /usr/src/app COPY tools/walletextension/frontend/ . # Install dependencies -RUN pnpm ci +RUN pnpm install --frozen-lockfile # Build the Next.js app RUN pnpm run build @@ -29,6 +29,9 @@ RUN pnpm run build # Reduce the size of the final image by using a lighter base image FROM node:20-alpine AS runner +# Install pnpm +RUN npm install -g pnpm + # Set the working directory WORKDIR /usr/src/app @@ -36,10 +39,10 @@ WORKDIR /usr/src/app COPY --from=base /usr/src/app/.next ./.next COPY --from=base /usr/src/app/public ./public COPY --from=base /usr/src/app/package*.json ./ +COPY --from=base /usr/src/app/pnpm-lock.yaml ./ # Install production dependencies -RUN pnpm ci --production - +RUN pnpm install --prod --frozen-lockfile # Set the environment variables ENV PORT=80