@@ -10,13 +10,10 @@ FROM base AS deps
10
10
WORKDIR /app
11
11
12
12
# 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
+
20
17
21
18
22
19
FROM base AS dev
@@ -37,13 +34,11 @@ COPY . .
37
34
# Learn more here: https://nextjs.org/telemetry
38
35
# Uncomment the following line in case you want to disable telemetry during the build.
39
36
ENV NEXT_TELEMETRY_DISABLED 1
37
+ # optimize Build size by inclduding only required resources
38
+ ENV NEXT_CONFIG_BUILD_OUTPUT standalone
40
39
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
47
42
48
43
49
44
# Production image, copy all the files and run next
@@ -72,4 +67,4 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
72
67
USER nextjs
73
68
74
69
75
- CMD [ "node" , " server.js" ]
70
+ CMD [ "sh" , "-c" , "PORT=${CADENCE_WEB_PORT:-8088} exec node server.js" ]
0 commit comments