我紧跟着React Pro 16本书,并希望使用如下所示的heroku.yml文件将我的应用程序部署到heroku。
build:
docker:
web: Dockerfile
我的dockerfile在根目录中,看起来像这样
FROM node:10.14.1
RUN mkdir -p /usr/src/sportsstore
COPY build /usr/src/sportsstore/build
COPY authMiddleware.js /usr/src/sportsstore/
COPY productionData.json /usr/src/sportsstore/
COPY server.js /usr/src/sportsstore/
COPY deploy-package.json /usr/src/sportsstore/package.json
COPY serverQueriesSchema.graphql /usr/src/sportsstore/
COPY serverQueriesResolver.js /usr/src/sportsstore/
COPY serverMutationsSchema.graphql /usr/src/sportsstore/
COPY serverMutationsResolver.js /usr/src/sportsstore/
WORKDIR /usr/src/sportsstore
RUN echo 'package-lock=false' >> .npmrc
RUN npm install
EXPOSE 80
CMD ["node", "server.js", "./productionData.json", "80"]
为了运行本地,我运行两个命令
docker build . -t sportsstore -f Dockerfile
docker run -p 80:80 sportstore
我的应用正在寻找体育用品店目录,因此部署失败
Step 3/16 : COPY build /usr/src/sportsstore/build
COPY failed: stat /var/lib/docker/tmp/docker-builder064519013/build: no such file or directory
我如何在我的heroku.yml中添加运行哪些命令以创建目录并运行该应用程序?