FROM node:14.16.1 ARG NODE_ENV=development ENV NODE_ENV=$NODE_ENV # Set a working directory WORKDIR /usr/src/app # COPY ./cert cert # Install Node.js dependencies COPY package.json yarn.lock ./ RUN npm config set registry https://registry.npm.taobao.org #RUN npm config set unsafe-perm true # COPY ./patches patches RUN npm install --production; RUN npm run postinstall; RUN mkdir upload && mkdir upload/file RUN touch swagger-spec.json && chmod 777 swagger-spec.json RUN chmod 777 -R upload RUN touch error.log && chmod 777 error.log COPY dist* ./ RUN ls COPY production.env production.env COPY production.env development.env # Run the container under "node" user by default USER node CMD [ "node", "src/main.js" ]