main
Last change
on this file since 5d6f37a was 5d6f37a, checked in by Naum Shapkarovski <naumshapkarovski@…>, 7 weeks ago |
add customer
|
-
Property mode
set to
100644
|
File size:
884 bytes
|
Line | |
---|
1 | FROM node:18-alpine AS deps
|
---|
2 | RUN apk add --no-cache libc6-compat
|
---|
3 |
|
---|
4 | WORKDIR /app
|
---|
5 | COPY package.json yarn.lock ./
|
---|
6 | RUN yarn install --frozen-lockfile
|
---|
7 |
|
---|
8 | FROM node:18-alpine AS builder
|
---|
9 | WORKDIR /app
|
---|
10 | COPY --from=deps /app/node_modules ./node_modules
|
---|
11 | COPY . .
|
---|
12 |
|
---|
13 | ARG APP_ENV
|
---|
14 | RUN yarn build -e $APP_ENV
|
---|
15 |
|
---|
16 | FROM node:18-alpine AS runner
|
---|
17 | WORKDIR /app
|
---|
18 |
|
---|
19 | ENV NODE_ENV production
|
---|
20 |
|
---|
21 | RUN addgroup -g 1001 -S nodejs
|
---|
22 | RUN adduser -S mvpmasters -u 1001
|
---|
23 |
|
---|
24 | COPY --from=builder /app/next.config.js ./next.config.js
|
---|
25 | COPY --from=builder /app/public ./public
|
---|
26 |
|
---|
27 | # Set the correct permission for prerender cache
|
---|
28 | RUN mkdir .next
|
---|
29 | RUN chown mvpmasters:nodejs .next
|
---|
30 |
|
---|
31 | COPY --from=builder --chown=mvpmasters:nodejs /app/.next ./.next
|
---|
32 | COPY --from=builder /app/node_modules ./node_modules
|
---|
33 | COPY --from=builder /app/package.json ./package.json
|
---|
34 |
|
---|
35 | USER mvpmasters
|
---|
36 |
|
---|
37 | EXPOSE 3000
|
---|
38 |
|
---|
39 | ARG APP_ENV
|
---|
40 | ENV APP_ENV=$APP_ENV
|
---|
41 | CMD yarn start -e $APP_ENV |
---|
Note:
See
TracBrowser
for help on using the repository browser.