You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
7
+
RUN apk add --no-cache libc6-compat
3
8
WORKDIR /app
4
9
5
10
# set mirror for npm
6
11
# RUN npm config set registry https://registry.npmmirror.com
7
12
13
+
# Install dependencies based on the preferred package manager
8
14
COPY ./moon/package*.json ./
9
-
10
15
RUN npm install
11
16
17
+
18
+
# Rebuild the source code only when needed
19
+
FROM base AS builder
20
+
WORKDIR /app
21
+
COPY --from=deps /app/node_modules ./node_modules
12
22
COPY ./moon .
13
23
24
+
# Next.js collects completely anonymous telemetry data about general usage.
25
+
# Learn more here: https://nextjs.org/telemetry
26
+
# Uncomment the following line in case you want to disable telemetry during the build.
27
+
ENV NEXT_TELEMETRY_DISABLED=1
28
+
14
29
RUN npm run build
15
30
31
+
# Production image, copy all the files and run next
32
+
FROM base AS runner
33
+
WORKDIR /app
34
+
35
+
ENV NODE_ENV=production
36
+
# Uncomment the following line in case you want to disable telemetry during runtime.
37
+
ENV NEXT_TELEMETRY_DISABLED=1
38
+
39
+
RUN addgroup --system --gid 1001 nodejs
40
+
RUN adduser --system --uid 1001 nextjs
41
+
42
+
COPY --from=builder /app/public ./public
43
+
16
44
COPY ./docker/start-moon.sh /app/start-moon.sh
17
45
18
46
RUN chmod +x /app/start-moon.sh
19
47
48
+
# Set the correct permission for prerender cache
49
+
RUN mkdir .next
50
+
RUN chown nextjs:nodejs .next
51
+
52
+
# Automatically leverage output traces to reduce image size
0 commit comments