You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
758 B
Docker
42 lines
758 B
Docker
FROM --platform=$BUILDPLATFORM node:lts as npm
|
|
|
|
RUN mkdir -p /usr/src/build && \
|
|
chown -R node:node /usr/src/build
|
|
WORKDIR /usr/src/build
|
|
|
|
ARG NODE_ENV
|
|
ENV NODE_ENV $NODE_ENV
|
|
|
|
COPY --chown=node:node install/package.json /usr/src/build/package.json
|
|
|
|
USER node
|
|
|
|
RUN npm install --omit=dev
|
|
|
|
|
|
FROM node:lts
|
|
|
|
RUN mkdir -p /usr/src/app && \
|
|
chown -R node:node /usr/src/app
|
|
WORKDIR /usr/src/app
|
|
|
|
ARG NODE_ENV
|
|
ENV NODE_ENV $NODE_ENV
|
|
|
|
COPY --chown=node:node --from=npm /usr/src/build /usr/src/app
|
|
|
|
USER node
|
|
|
|
RUN npm rebuild && \
|
|
npm cache clean --force
|
|
|
|
COPY --chown=node:node . /usr/src/app
|
|
|
|
ENV NODE_ENV=production \
|
|
daemon=false \
|
|
silent=false
|
|
|
|
EXPOSE 4567
|
|
|
|
CMD test -n "${SETUP}" && ./nodebb setup || node ./nodebb build; node ./nodebb start
|