File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- FROM node:20.19.0 AS base
1+ FROM node:20.19.0-alpine AS deps
2+
23WORKDIR /app
34
4- FROM base AS deps
5- COPY package.json yarn.lock ./
6- RUN yarn install --frozen-lockfile
5+ # Install dependencies (use lockfile if present for reproducible builds)
6+ COPY package.json yarn.lock* ./
7+ RUN if [ -f yarn.lock ]; then yarn install --frozen-lockfile; else yarn install; fi
78
8- FROM base AS builder
9- COPY --from=deps /app/node_modules ./node_modules
10- COPY . .
11- RUN yarn run build
9+ FROM node:20.19.0-alpine AS builder
1210
13- FROM base AS runner
11+ WORKDIR /app
1412ENV NODE_ENV=production
13+
14+ COPY . .
15+ COPY --from=deps /app/node_modules ./node_modules
16+
17+ RUN yarn run build:staging
18+
19+ FROM node:20.19.0-alpine AS runner
20+
1521WORKDIR /app
16- COPY --from=builder /app/package.json ./package.json
17- COPY --from=builder /app/next.config.js ./next.config.js
22+ ENV NODE_ENV=production
23+ ENV NEXT_TELEMETRY_DISABLED=1
24+ ENV PORT=3005
25+
26+ # Copy only the minimal standalone output
1827COPY --from=builder /app/public ./public
19- COPY --from=builder /app/.next ./.next
20- COPY --from=builder /app/node_modules ./node_modules
28+ COPY --from=builder /app/.next/standalone ./
29+ COPY --from=builder /app/.next/static ./.next/static
30+
2131EXPOSE 3005
22- CMD ["yarn" , "run" , "start:staging" ]
32+
33+ CMD ["node" , "server.js" ]
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ module.exports = async () => {
2020 defaultLocale : 'en' ,
2121 } ,
2222 assetPrefix : isLocal ? '' : '/uxcore_next' ,
23+ output : 'standalone' ,
2324 async rewrites ( ) {
2425 return [
2526 {
You can’t perform that action at this time.
0 commit comments