File tree 2 files changed +39
-0
lines changed
2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM node:18.17.0-alpine as base
2
+
3
+ FROM base as deps
4
+ RUN apk add --no-cache libc6-compat
5
+ WORKDIR /app
6
+
7
+ COPY package.json /app
8
+ COPY yarn.lock /app
9
+ RUN --mount=type=secret,id=npmrc,target=/root/.npmrc yarn install
10
+
11
+ FROM base as builder
12
+ WORKDIR /app
13
+ COPY --from=deps /app/node_modules ./node_modules
14
+ COPY . .
15
+
16
+ RUN yarn build
17
+
18
+ FROM base AS runner
19
+ WORKDIR /app
20
+
21
+ RUN addgroup --system --gid 1001 nodejs
22
+ RUN adduser --system --uid 1001 nextjs
23
+
24
+ COPY --from=builder /app/public ./public
25
+
26
+ RUN mkdir .next
27
+ RUN chown nextjs:nodejs .next
28
+
29
+ COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
30
+ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
31
+
32
+
33
+ USER nextjs
34
+
35
+ EXPOSE 3000
36
+ ENV HOSTNAME "0.0.0.0"
37
+
38
+ CMD ["node" , "server.js" ]
Original file line number Diff line number Diff line change 1
1
/** @type {import('next').NextConfig } */
2
2
const nextConfig = {
3
+ output : 'standalone' ,
3
4
async rewrites ( ) {
4
5
return [
5
6
{
You can’t perform that action at this time.
0 commit comments