npaste is a simple pastebin for text and images, supporting end-to-end encryption using GPG.
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.
 
 
 
 
 

36 lines
750 B

FROM node:9.5.0 as builder
ARG NODE_ENV=production
ENV NODE_ENV $NODE_ENV
WORKDIR /home/node/app
COPY src/package*.json ./
RUN npm install && npm cache clean --force
FROM node:9.5.0-alpine as app
ARG PORT=3000
ENV PORT $PORT
EXPOSE $PORT
ARG NODE_ENV=production
ENV NODE_ENV $NODE_ENV
ARG NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV NPM_CONFIG_PREFIX=$NPM_CONFIG_PREFIX
ENV PATH /home/node/.npm-global/bin:$PATH
WORKDIR /home/node/app
RUN npm install nodemon -g && mkdir -p /home/node/app/data && chown -R node:node /home/node/
VOLUME /home/node/app/data
COPY --chown=node:node --from=builder /home/node/app/node_modules node_modules/
COPY --chown=node:node ./src ./src
USER node:node
WORKDIR /home/node/app/src
CMD ["node", "bin/www"]