2024-04-28 00:33:06 -07:00
|
|
|
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
|
2024-04-28 01:29:25 -07:00
|
|
|
COPY --from=build /usr/src/app/out out
|
|
|
|
COPY --from=build /usr/src/app/dist dist
|
2024-04-28 00:33:06 -07:00
|
|
|
COPY package.json .
|
|
|
|
|
|
|
|
EXPOSE 3000
|
2024-04-28 01:29:25 -07:00
|
|
|
ENTRYPOINT [ "node", "./out/server/index.js" ]
|