FROM node:lts
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
RUN mkdir -p /home/node/app/.npm && chown -R node:node /home/node/app/.npm
RUN mkdir -p /home/node/.npm && chown -R node:node /home/node/.npm
RUN mkdir -p /.npm && chown -R node:node /.npm
RUN chown -R 1000650000:0 "/.npm"
RUN chown -R 1000650000:0 "/home/node/.npm"
RUN chown -R 1000650000:0 "/home/node/app/.npm"
WORKDIR /home/node/app
COPY --chown=node:node . .
RUN npm config set cache /home/node/app/.npm/
RUN npm install
EXPOSE 5000
USER node
CMD ["npm", "run", "dev"]

