Skip to content

Commit 2ac0a5d

Browse files
committed
fix(Dockerfile): Small changes fixing dev and prod builds
Signed-off-by: Alexander Jung <alex@unikraft.cloud>
1 parent a5c3d96 commit 2ac0a5d

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

Dockerfile

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,27 @@
11
FROM node:20-alpine AS base
22

33
# Install dependencies only when needed
4-
FROM base AS deps
4+
FROM base AS dev
55
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
66

77
RUN apk add --no-cache libc6-compat
88

99
WORKDIR /docs
1010

11-
# Install dependencies based on the preferred package manager
12-
COPY package.json package-lock.json* ./
13-
14-
RUN npm install --verbose
15-
16-
# Dev image
17-
FROM base AS dev
18-
1911
ENV NODE_ENV=development
2012
ENV NEXT_TELEMETRY_DISABLED=1
2113

22-
WORKDIR /docs
23-
24-
COPY --from=deps /docs/node_modules ./node_modules
25-
2614
COPY . .
2715

28-
RUN npm run search-meta:gen
16+
RUN npm install
2917

3018
CMD ["npm", "run", "dev"]
3119

3220
# Rebuild the source code only when needed
33-
FROM base AS builder
21+
FROM dev AS builder
3422

3523
WORKDIR /docs
3624

37-
COPY --from=deps /docs/node_modules ./node_modules
38-
39-
COPY . .
40-
4125
ENV NEXT_TELEMETRY_DISABLED 1
4226

4327
RUN set -xe; \

0 commit comments

Comments
 (0)