mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-21 21:36:26 -08:00
25 lines
554 B
Docker
25 lines
554 B
Docker
FROM node:21-alpine AS base
|
|
WORKDIR /usr/src/app
|
|
|
|
FROM base AS install
|
|
RUN mkdir -p /tmp/dev
|
|
COPY package.json package-lock.json /tmp/dev/
|
|
RUN cd /tmp/dev && npm install
|
|
|
|
RUN mkdir -p /tmp/prod
|
|
COPY package.json package-lock.json /tmp/prod/
|
|
RUN cd /tmp/prod && npm install --omit=dev
|
|
|
|
FROM base AS build
|
|
COPY --from=install /tmp/dev/node_modules node_modules
|
|
COPY . .
|
|
|
|
RUN npm run build
|
|
|
|
FROM base AS app
|
|
COPY --from=install /tmp/prod/node_modules node_modules
|
|
COPY --from=build out ./
|
|
COPY package.json .
|
|
|
|
EXPOSE 3000
|
|
ENTRYPOINT [ "node", "./index.js" ] |