You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
611 B
19 lines
611 B
FROM node:latest AS build
|
|
RUN apt-get update && apt-get install -y --no-install-recommends dumb-init
|
|
WORKDIR /usr/src/app
|
|
COPY src /usr/src/app/
|
|
COPY package*.json /usr/src/app/
|
|
RUN npm ci
|
|
RUN npm run lint
|
|
RUN npm run build
|
|
RUN npm ci --production
|
|
|
|
FROM node:16.17.0-bullseye-slim
|
|
|
|
ENV NODE_ENV production
|
|
COPY --from=install /usr/bin/dumb-init /usr/bin/dumb-init
|
|
USER node
|
|
WORKDIR /usr/src/app
|
|
COPY --chown=node:node --from=build /usr/src/app/node_modules /usr/src/app/node_modules
|
|
COPY --chown=node:node --from=build /usr/src/app/dist /usr/src/app/dist
|
|
CMD ["dumb-init", "node", "/usr/src/app/dist/index.js"]
|
|
|