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+ /node_modules
2+ /.github
3+ /.git
4+ /build
Original file line number Diff line number Diff line change 1+ # Install dependencies only when needed
2+ FROM node:16-alpine AS deps
3+ # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
4+ RUN apk add --no-cache libc6-compat
5+ WORKDIR /app
6+
7+ COPY package.json yarn.lock ./
8+
9+ RUN yarn install
10+
11+ # Rebuild the source code only when needed
12+ FROM node:16-alpine AS builder
13+ WORKDIR /app
14+
15+ COPY --from=deps /app/node_modules ./node_modules
16+ COPY . .
17+
18+ RUN yarn build
19+
20+ # Production image, copy all the files and run next
21+ FROM nginx:1.20-alpine AS runner
22+ WORKDIR /app
23+
24+ COPY --from=builder /app/build /usr/share/nginx/html
25+
26+ EXPOSE 80
27+ ENV PORT 80
28+
29+ CMD ["nginx" , "-g" , "daemon off;" ]
You can’t perform that action at this time.
0 commit comments