@@ -10,13 +10,10 @@ FROM base AS deps
1010WORKDIR /app
1111
1212# Install dependencies based on the preferred package manager
13- COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
14- RUN \
15- if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
16- elif [ -f package-lock.json ]; then npm ci; \
17- elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
18- else echo "Lockfile not found." && exit 1; \
19- fi
13+ COPY package.json package-lock.json ./
14+ RUN npm ci
15+ RUN npm run install-idl
16+
2017
2118
2219FROM base AS dev
@@ -37,13 +34,11 @@ COPY . .
3734# Learn more here: https://nextjs.org/telemetry
3835# Uncomment the following line in case you want to disable telemetry during the build.
3936ENV NEXT_TELEMETRY_DISABLED 1
37+ # optimize Build size by inclduding only required resources
38+ ENV NEXT_CONFIG_BUILD_OUTPUT standalone
4039
41- RUN \
42- if [ -f yarn.lock ]; then yarn run build; \
43- elif [ -f package-lock.json ]; then npm run build; \
44- elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \
45- else echo "Lockfile not found." && exit 1; \
46- fi
40+ RUN npm run generate:idl
41+ RUN npm run build
4742
4843
4944# Production image, copy all the files and run next
@@ -72,4 +67,4 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
7267USER nextjs
7368
7469
75- CMD [ "node" , " server.js" ]
70+ CMD [ "sh" , "-c" , "PORT=${CADENCE_WEB_PORT:-8088} exec node server.js" ]
0 commit comments