2022-09-11 06:54:45 +02:00
|
|
|
FROM node:16.17.0-alpine AS node-build
|
2021-08-26 02:16:09 +02:00
|
|
|
WORKDIR /usr/src/app
|
|
|
|
COPY package.json ./
|
|
|
|
COPY yarn.lock ./
|
|
|
|
COPY src ./src
|
|
|
|
COPY public ./public
|
2021-10-06 05:15:46 +02:00
|
|
|
RUN yarn install --frozen-lockfile --check-files --network-timeout 600000
|
2021-08-26 02:16:09 +02:00
|
|
|
RUN yarn build --noninteractive
|
2021-10-06 05:15:46 +02:00
|
|
|
RUN yarn install --frozen-lockfile --check-files --production --modules-folder node_modules_prod --network-timeout 600000
|
2021-08-26 02:16:09 +02:00
|
|
|
|
2022-09-11 06:54:45 +02:00
|
|
|
FROM node:16.17.0-alpine
|
2021-08-10 04:58:26 +02:00
|
|
|
WORKDIR /usr/src/app
|
2021-08-26 02:16:09 +02:00
|
|
|
ENV NODE_ENV production
|
|
|
|
RUN mkdir -p /node_modules
|
|
|
|
COPY --from=node-build /usr/src/app/build ./build
|
|
|
|
COPY --from=node-build /usr/src/app/node_modules_prod ./node_modules
|
2021-08-10 04:58:26 +02:00
|
|
|
EXPOSE 3000
|
2021-08-26 02:16:09 +02:00
|
|
|
CMD [ "node", "build/server.js" ]
|
2021-08-10 04:58:26 +02:00
|
|
|
|