2023-07-02 02:05:12 +00:00
|
|
|
FROM node:lts-hydrogen as common
|
|
|
|
|
|
|
|
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
|
|
|
|
ENV PATH=$PATH:/home/node/.npm-global/bin
|
|
|
|
|
|
|
|
|
|
|
|
WORKDIR /home/node/app
|
|
|
|
|
|
|
|
FROM common as build
|
|
|
|
|
|
|
|
COPY . /home/node/app
|
|
|
|
|
2024-01-01 15:34:03 +00:00
|
|
|
RUN npm ci
|
|
|
|
RUN npm run build
|
2023-07-02 02:05:12 +00:00
|
|
|
|
|
|
|
FROM common as app
|
|
|
|
|
|
|
|
COPY --from=build --chown=node:node /home/node/app/dist /home/node/app/dist
|
|
|
|
COPY --from=build --chown=node:node /home/node/app/public /home/node/app/public
|
2024-01-01 15:34:03 +00:00
|
|
|
COPY --from=build --chown=node:node /home/node/app/package.json /home/node/app/package-lock.json /home/node/app/
|
2023-07-02 02:05:12 +00:00
|
|
|
COPY --from=build --chown=node:node /home/node/app/node_modules /home/node/app/node_modules
|
|
|
|
|
|
|
|
RUN mkdir /home/node/app/data
|
|
|
|
|
|
|
|
ENTRYPOINT [ "node", "." ]
|