Skip to content
Permalink
43ff8c8f0f
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
39 lines (20 sloc) 631 Bytes
FROM node:16-slim
ENV USER=node
RUN apt-get update && apt-get install -y vim
RUN mkdir -p /home/node/app
WORKDIR /home/node/app
COPY . .
COPY package*.json ./
COPY tsconfig.json ./
RUN chown -R node:node /home/node/app
RUN mkdir /home/node/.npm-global
RUN chown -R 1000:1000 /home/node/.npm-global
ENV PATH=/home/node/.npm-global/bin:$PATH
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
RUN npm --global config set user "${USER}"
USER node
RUN npm install --loglevel=warn;
RUN npm i --location=global pm2
RUN npm run build
EXPOSE 6000
CMD [ "pm2-runtime", "--no-autorestart", "npm", "--", "run", "start-prod" ]