Missing `node_modules` in Docker Container
Then why don't you create this directory at build (ie adding the following line in your Dockerfile
before RUN npm install
) ?
RUN mkdir <workdir>/node_modules
(Replace <workdir>
with the actual default working dir of the keymetrics/pm2
image)
I would say it is a directory issue.You will want to set
ENV ROOT /usr/src/appWORKDIR ${ROOT}
before
# Bundle APP filesCOPY package.json .
example:
FROM node:8ENV ROOT /usr/src/appWORKDIR ${ROOT}COPY package*.json ./RUN yarn -i --quiet# Bundle app sourceCOPY . .ENV NODE_ENV developmentCMD yarn run start:devEXPOSE 3000