Ember js / Docker NPM问题 – node_modules显示为空

我用这个作为我的docker为我的烬Js和我试图让我的docker设置,但我正在运行到一个节点模块空错误..inheritance人我的文件

# 1: Use node 6.4.0 as base: FROM node:6.4.0 # 2: We'll set the application path as the working directory WORKDIR /usr/src/web-client # 3: We'll add the app's binaries path to $PATH: ENV PATH=/usr/src/web-client/bin:$PATH ADD package.json /tmp/package.json RUN cd /tmp && npm install RUN mkdir -p /opt/app && cp -a /tmp/node_modules /opt/app/ # 4: Install ember-cli and friends: RUN set -ex \ && npm install -g ember-cli \ && npm install -g bower \ && npm install -g phantomjs-prebuilt \ && npm install -g check-dependencies # 5: Install watchman: RUN set -ex \ && export WATCHMAN_VERSION=4.6.0 \ && curl -SL "https://github.com/facebook/watchman/archive/v${WATCHMAN_VERSION}.tar.gz" | tar -xz -C /tmp/ \ && cd /tmp/watchman-${WATCHMAN_VERSION} \ && ./autogen.sh \ && ./configure \ && apt-get update && apt-get install -y --no-install-recommends python-dev \ && make \ && make install \ && apt-get purge -y --auto-remove python-dev \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /tmp/* # 6: Expose the app and live-reload ports: EXPOSE 4200 35730 # 7: Set the default command: CMD ["ember", "server", "--live-reload-port", "35730"] 

这是我的docker撰写文件

 version: '2' services: web: image: selleo/ember-cli:2.7.0 build: context: . dockerfile: Dockerfile command: ember server --live-reload-port 35730 volumes: # Mount the app code inside the container's `/usr/src/app` directory: - .:/usr/src/web-client # Keep the stdin open, so we can attach to our app container's process # and do things such as debugging, etc: stdin_open: true # Enable sending signals (CTRL+C, CTRL+P + CTRL+Q) into the container: tty: true ports: # Bind the host's 4200 port to the container's ember app server # port 4200: - 4200:4200 # Bind the host's 35730 port to the container's ember cli live reload # server port 35730: - 35730:35730 volumes: - ./src:/var/www/html - /var/www/html/node_modules 

我得到这个错误:node_modules显示为空,您可能需要运行docker-compose时运行npm install 。 而我不确定,因为当我build立这个它表明它正在安装bower和npm文件。