FROM node:14.17.3 WORKDIR /tilesrv RUN npm install -g cnpm --registry=https://registry.npm.taobao.org RUN cnpm install pm2 -g COPY ./package.json /tilesrv/package.json RUN cnpm i COPY . /tilesrv EXPOSE 3000 ENV LD_LIBRARY_PATH=/tilesrv/bin:$LD_LIBRARY_PATH CMD ["pm2-runtime", "start.js", "-i", "4"] FROM node:14.17.3 WORKDIR /tilesrv RUN npm install -g cnpm --registry=https://registry.npm.taobao.org RUN npm install pm2 -g COPY ./package.json /tilesrv/package.json RUN npm i COPY . /tilesrv EXPOSE 3000 ENV LD_LIBRARY_PATH=/tilesrv/bin:$LD_LIBRARY_PATH CMD ["pm2-runtime", "start.js", "-i", "4"] FROM node:14.17.3 WORKDIR /tilesrv # 安装cnpm RUN npm install -g cnpm --registry=https://registry.npm.taobao.org # 设置工作目录 WORKDIR /tilesrv # 将package.json和package-lock.json(如果有)复制到容器中 COPY ./package.json /tilesrv/package.json COPY ./package-lock.json /tilesrv/package-lock.json # 安装项目依赖,使用npm RUN npm install # 将项目的所有文件复制到容器中 COPY . /tilesrv # 暴露容器的3000端口 EXPOSE 3000 # 运行应用程序 CMD ["./node_modules/.bin/pm2-runtime", "start.js", "-i", "4"] FROM node:14.17.3 WORKDIR /tilesrv # 安装cnpm RUN npm install -g cnpm --registry=https://registry.npm.taobao.org # 设置工作目录 WORKDIR /tilesrv # 将package.json和yarn.lock(如果有)复制到容器中 COPY ./package.json /tilesrv/package.json COPY ./yarn.lock /tilesrv/yarn.lock # 安装项目依赖,使用yarn RUN yarn install # 将项目的所有文件复制到容器中 COPY . /tilesrv # 暴露容器的3000端口 EXPOSE 3000 # 运行应用程序 CMD ["yarn", "run", "start"]
标签:npm,tilesrv,package,切图,json,RUN,COPY From: https://www.cnblogs.com/elfin/p/17801886.html