1
|
FROM node:lts as build
|
2
|
|
3
|
ENV NPM_CONFIG_LOGLEVEL warn
|
4
|
WORKDIR app
|
5
|
|
6
|
COPY package.json package.json
|
7
|
COPY yarn.lock yarn.lock
|
8
|
RUN yarn install --pure-lockfile
|
9
|
|
10
|
COPY . .
|
11
|
|
12
|
RUN npx browserslist@latest --update-db
|
13
|
RUN yarn build
|
14
|
|
15
|
FROM node:lts
|
16
|
WORKDIR app
|
17
|
|
18
|
COPY package.json package.json
|
19
|
COPY yarn.lock yarn.lock
|
20
|
RUN yarn install --pure-lockfile --production
|
21
|
|
22
|
COPY --from=build app/.next .next
|
23
|
COPY --from=build app/public public
|
24
|
|
25
|
ENV NPM_CONFIG_LOGLEVEL warn
|
26
|
|
27
|
|
28
|
ARG BACKEND_URL=$BACKEND_URL
|
29
|
ENV BACKEND_URL=$BACKEND_URL
|
30
|
|
31
|
EXPOSE 5000
|
32
|
|
33
|
CMD yarn start -p 5000
|