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 set strict-ssl false RUN npm install --production; RUN npm run postinstall; RUN mkdir upload && mkdir upload/file && mkdir download RUN touch swagger-spec.json && chmod 777 swagger-spec.json RUN chmod 777 -R upload RUN chmod 777 -R download 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 RUN mkdir apk COPY ./src/apk/app.apk apk/app.apk USER node CMD [ "node", "main.js" ] # CMD [ "node", "src/main.js" ]