Skip to content

Commit

Permalink
fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
zkokelj committed Nov 2, 2024
1 parent 4c162f2 commit 6c7363a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tools/walletextension/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -21,25 +21,28 @@ 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

# 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

# Copy only the necessary files from the build stage
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
Expand Down

0 comments on commit 6c7363a

Please sign in to comment.