1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-07-19 13:19:42 +02:00
codex.docs/docker/Dockerfile.prod

34 lines
678 B
Text
Raw Normal View History

2022-03-06 13:37:06 +04:00
# Stage 1 - build
FROM node:16.14.0-alpine3.15 as build
2020-11-23 14:09:33 +03:00
## Install build toolchain, install node deps and compile native add-ons
2022-09-29 06:41:24 +08:00
RUN apk add --no-cache python3 make g++ git
2020-11-23 14:09:33 +03:00
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn install --production
RUN cp -R node_modules prod_node_modules
RUN yarn install
2020-11-23 14:09:33 +03:00
COPY . .
RUN yarn build-all
2022-03-06 13:37:06 +04:00
# Stage 2 - make final image
FROM node:16.14.0-alpine3.15
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
COPY --from=build /usr/src/app/prod_node_modules ./node_modules
2022-03-06 13:37:06 +04:00
COPY --from=build /usr/src/app/dist ./dist
COPY --from=build /usr/src/app/public ./public
ENV NODE_ENV=production
CMD ["node", "dist/backend/app.js"]