Docker撰写无法安装

时间:2018-04-06 10:01:21

标签: node.js docker docker-compose yarnpkg

我正在尝试使用docker compose进行卷装。

搬运工-compose.yml

version: '3.5'

services:

  myapp:
    container_name: myapp
    image: myapp
    build:
      context: .
      dockerfile: development.dockerfile
    volumes:
      - .:/usr/src/app
    ports:
      - "80:80"
      - "443:443"
      - "3005:3005"
      - "5000:5000"
    networks:
      - myapp-network      
    environment:
      - NODE_ENV=development

networks:
  myapp-network:
    driver: bridge

development.dockerfile

FROM node:carbon

LABEL Foo bar

ENV CONTAINER_PATH /usr/src/app

WORKDIR $CONTAINER_PATH

EXPOSE 80 443 3005 5000

ENTRYPOINT [ "yarn","start" ]

但是当我这样做时

docker-compose build ===> OK
docker-compose up ===> Throws below error


Attaching to myapp
client       | yarn run v1.5.1
client       | error An unexpected error occurred: "Couldn't find a package.json file in \"/usr/src/app\"".
client       | info If you think this is a bug, please open a bug report with the information provided in "/usr/src/app/yarn-error.log".
client       | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
client exited with code 1

package.json文件确实存在于当前目录中,即'。' (按卷)

有什么想法吗?

主机操作系统:Windows 客户操作系统:node:carbon(linux)

由于

0 个答案:

没有答案